Project

General

Profile

Download (95.4 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2009 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/ 
9

    
10
/**
11
 * This is EndNote import format
12
 * 
13
 * EndNote is a commercial reference management software package, 
14
 * used to manage bibliographies and references when writing essays and articles.
15
 */
16
package eu.etaxonomy.cdm.io.reference.endnote.in;
17

    
18
import java.util.ArrayList;
19
import java.util.HashMap;
20
import java.util.List;
21
import java.util.Map;
22

    
23
import org.apache.log4j.Logger;
24
import org.jdom.Element;
25
import org.jdom.Namespace;
26
import org.springframework.stereotype.Component;
27

    
28
import eu.etaxonomy.cdm.api.service.IReferenceService;
29
import eu.etaxonomy.cdm.common.DoubleResult;
30
import eu.etaxonomy.cdm.common.XmlHelp;
31
import eu.etaxonomy.cdm.io.common.ICdmIO;
32
import eu.etaxonomy.cdm.io.common.ImportHelper;
33
import eu.etaxonomy.cdm.io.common.MapWrapper;
34
import eu.etaxonomy.cdm.model.agent.Address;
35
import eu.etaxonomy.cdm.model.agent.Contact;
36
import eu.etaxonomy.cdm.model.agent.Institution;
37
import eu.etaxonomy.cdm.model.agent.Team;
38
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
39
import eu.etaxonomy.cdm.model.common.Annotation;
40
import eu.etaxonomy.cdm.model.common.CdmBase;
41
import eu.etaxonomy.cdm.model.common.ExtensionType;
42
import eu.etaxonomy.cdm.model.common.Language;
43
import eu.etaxonomy.cdm.model.reference.IArticle;
44
import eu.etaxonomy.cdm.model.reference.IBook;
45
import eu.etaxonomy.cdm.model.reference.IBookSection;
46
import eu.etaxonomy.cdm.model.reference.ICdDvd;
47
import eu.etaxonomy.cdm.model.reference.IDatabase;
48
import eu.etaxonomy.cdm.model.reference.IGeneric;
49
import eu.etaxonomy.cdm.model.reference.IJournal;
50
import eu.etaxonomy.cdm.model.reference.IPatent;
51
import eu.etaxonomy.cdm.model.reference.IPersonalCommunication;
52
import eu.etaxonomy.cdm.model.reference.IPrintSeries;
53
import eu.etaxonomy.cdm.model.reference.IPrintedUnitBase;
54
import eu.etaxonomy.cdm.model.reference.IProceedings;
55
import eu.etaxonomy.cdm.model.reference.IPublicationBase;
56
import eu.etaxonomy.cdm.model.reference.ReferenceBase;
57
import eu.etaxonomy.cdm.model.reference.IReport;
58
import eu.etaxonomy.cdm.model.reference.IThesis;
59
import eu.etaxonomy.cdm.model.reference.IWebPage;
60
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
61
/**
62
 * @author a.bukhman
63
 *
64
 */
65
@Component
66
public class EndnoteRecordsImport extends EndNoteImportBase implements ICdmIO<EndnoteImportState> {
67
	private static final Logger logger = Logger.getLogger(EndnoteRecordsImport.class);
68

    
69
	private static int modCount = 1000;
70
	ReferenceFactory refFactory = ReferenceFactory.newInstance();
71
	
72
	public EndnoteRecordsImport(){
73
		super();
74
	}
75
	
76
	@Override
77
	public boolean doCheck(EndnoteImportState state){
78
		boolean result = true;
79
		return result;
80
	}
81
		
82
	@Override
83
	public boolean doInvoke(EndnoteImportState state){
84
		logger.info("start make XML ...");
85
		boolean success = true;
86
		String childName;
87
		boolean obligatory;
88
		
89
		MapWrapper<Team> authorMap = (MapWrapper<Team>)state.getStore(ICdmIO.TEAM_STORE);
90
		MapWrapper<ReferenceBase> referenceMap = (MapWrapper<ReferenceBase>)state.getStore(ICdmIO.REFERENCE_STORE);
91
		
92
		Map<String, ReferenceBase> map_article = new HashMap<String, ReferenceBase>();
93
		Map<String, ReferenceBase> map_book = new HashMap<String, ReferenceBase>();
94
		Map<String, ReferenceBase> map_book_section = new HashMap<String, ReferenceBase>();
95
		Map<String, ReferenceBase> map_journal = new HashMap<String, ReferenceBase>();
96
		Map<String, ReferenceBase> map_thesis = new HashMap<String, ReferenceBase>();
97
		Map<String, ReferenceBase> map_patent = new HashMap<String, ReferenceBase>();
98
		Map<String, ReferenceBase> map_proceedings = new HashMap<String, ReferenceBase>();
99
		Map<String, ReferenceBase> map_cdDvd = new HashMap<String, ReferenceBase>();
100
		Map<String, ReferenceBase> map_report = new HashMap<String, ReferenceBase>();
101
		Map<String, ReferenceBase> map_database = new HashMap<String, ReferenceBase>();
102
		Map<String, ReferenceBase> map_webPage = new HashMap<String, ReferenceBase>();
103
		Map<String, ReferenceBase> map_generic = new HashMap<String, ReferenceBase>();
104
		Map<String, ReferenceBase> map_printSeries = new HashMap<String, ReferenceBase>();
105
		Map<String, ReferenceBase> map_personalCommunication = new HashMap<String, ReferenceBase>();
106
		 
107
		IReferenceService referenceService = getReferenceService();
108
		
109
		EndnoteImportConfigurator config = state.getConfig();
110
		Element elXml = getXmlElement(config);
111
		Namespace tcsNamespace = config.getEndnoteNamespace();
112
		
113
		logger.info("start make Records-Element ...");
114
		DoubleResult<Element, Boolean> doubleResult;	
115
		 
116
		childName = "records";
117
		obligatory = false;
118
		doubleResult = XmlHelp.getSingleChildElement(elXml, childName, tcsNamespace, obligatory);
119
		Element elRecords = doubleResult.getFirstResult();
120
		success &= doubleResult.getSecondResult();
121
		elRecords.getAttributes();
122

    
123
		logger.info("start make Record-Elementen ...");
124
	    String tcsElementName = "record";
125
		String idNamespace = "record";
126
		List<Element> elRecordList = (List<Element>)elRecords.getChildren(tcsElementName, tcsNamespace);
127
		ReferenceBase reference = null;	
128
		TeamOrPersonBase<?> author = null;
129
		IPrintedUnitBase printedUnitBase = null;
130
		
131
		
132
		int i = 0;
133
		// for each Record in Endnote
134
		for (Element elRecord : elRecordList){
135
			if ((++i % modCount) == 0){ logger.info("Names handled: " + (i-1));}
136
			List<String> elementList = new ArrayList<String>();
137
			//create Record element
138
			IPublicationBase publicationBase = null;			
139
			CdmBase cdmBase = null;   
140
			
141
			ReferenceBase article = refFactory.newArticle();				
142
			ReferenceBase book = refFactory.newBook();
143
			ReferenceBase bookSection = refFactory.newBookSection();
144
			ReferenceBase thesis = refFactory.newThesis();
145
			ReferenceBase journal = refFactory.newJournal();
146
			ReferenceBase patent =  refFactory.newPatent();
147
			ReferenceBase generic = refFactory.newGeneric();
148
			ReferenceBase personalCommunication = refFactory.newPersonalCommunication();
149
			ReferenceBase proceedings  = refFactory.newProceedings();
150
			ReferenceBase printSeries = refFactory.newPrintSeries();
151
			ReferenceBase cdDvd = refFactory.newCdDvd();
152
			ReferenceBase database = refFactory.newDatabase();
153
			ReferenceBase report = refFactory.newReport();
154
			ReferenceBase webPage = refFactory.newWebPage();
155
			Institution school = Institution.NewInstance();
156
			Team authorTeam = Team.NewInstance();		 
157
			
158
			logger.info("start make database ...");
159
			childName = "database";
160
			obligatory = false;
161
			doubleResult = XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
162
			success &= doubleResult.getSecondResult();
163
			Element elDatabase = new Element ("database");
164
						
165
			if (elDatabase != null) {
166
			
167
				String strName = elDatabase.getAttributeValue("name");
168
				String strPath = elDatabase.getAttributeValue("path");
169
			}
170
				
171
			logger.info("start make source-app ...");
172
			childName = "source-app";
173
			obligatory = false;
174
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
175
			success &= doubleResult.getSecondResult();
176
			Element elSource_app = doubleResult.getFirstResult();
177
			if (elSource_app != null) {
178
				
179
				String strName_app = elSource_app.getAttributeValue("name");
180
				String strVersion = elSource_app.getAttributeValue("version");
181
			}
182
		
183
			logger.info("start make rec-number ...");
184
			childName = "rec-number";
185
			obligatory = false;
186
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
187
			success &= doubleResult.getSecondResult();
188
			Element elRec_number = doubleResult.getFirstResult();
189
			String nummer = elRec_number.getTextNormalize(); 
190
			int num = Integer.parseInt(nummer);
191
		
192
			if (cdmBase != null) {  
193
				reference.setId(num);
194
				cdmBase.setId(num);
195
			} else {
196
				logger.warn("The type was not found...");
197
				success = false;
198
			}
199
			 	
200
			logger.info("start make foreign-keys ...");
201
			childName = "foreign-keys";
202
			obligatory = false;
203
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
204
			success &= doubleResult.getSecondResult();
205
			Element elForeing_keys = doubleResult.getFirstResult();
206
			if (elForeing_keys!= null) {
207
				childName = "key";
208
				obligatory = false;
209
				doubleResult =  XmlHelp.getSingleChildElement(elForeing_keys, childName, tcsNamespace, obligatory);
210
				success &= doubleResult.getSecondResult();
211
				Element elKey = doubleResult.getFirstResult();
212
				if (elKey != null) {
213
					String strApp = elKey.getAttributeValue("app");
214
					String strDb_Id = elKey.getAttributeValue("db-id");
215
				}
216
			}
217
			
218
			logger.info("start make ref-type ...");
219
			childName = "ref-type";
220
			obligatory = false;
221
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
222
			success &= doubleResult.getSecondResult();
223
			Element elRef_type = doubleResult.getFirstResult();
224
			
225
			if (elRef_type != null) {	
226
				String strName_reftype = elRef_type.getAttributeValue("name");			
227
				if (strName_reftype.equals("Article")) {
228
					reference =  article;
229
				}else if (strName_reftype.equals("Book")){
230
					reference =  book;
231
				}else if (strName_reftype.equals("Book Section")){
232
					reference =  bookSection;
233
				}else if (strName_reftype.equalsIgnoreCase("Patent")) {
234
					reference =  patent;
235
				}else if (strName_reftype.equalsIgnoreCase("Personal Communication")){
236
					reference = personalCommunication;
237
				}else if (strName_reftype.equalsIgnoreCase("Journal")) {
238
					reference = journal;
239
				}else if (strName_reftype.equalsIgnoreCase("CdDvd")) {
240
					reference = cdDvd;
241
				}else if (strName_reftype.equalsIgnoreCase("Database")) {
242
					reference = database;
243
				}else if (strName_reftype.equalsIgnoreCase("WebPage")) {
244
					reference = webPage;
245
				}else if (strName_reftype.equalsIgnoreCase("Report")) {
246
					reference = report;
247
				}else if (strName_reftype.equalsIgnoreCase("Thesis")) {
248
					reference = thesis;
249
				}else if (strName_reftype.equalsIgnoreCase("Print Series")){
250
					reference = printSeries;
251
				}else if (strName_reftype.equals("Journal Article")){
252
					reference = article;
253
				}else if (strName_reftype.equalsIgnoreCase("Conference Proceedings")){
254
					reference = proceedings;
255
				}else if (strName_reftype.equalsIgnoreCase("Web Page")){
256
					reference = webPage;
257
				}else {
258
					logger.warn("The type was not found...");
259
					reference = (ReferenceBase) generic;
260
					success = false;
261
				}		 			
262
			}
263
			
264
			logger.info("start make contributors ...");
265
			childName = "contributors";
266
			obligatory = false;
267
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
268
			success &= doubleResult.getSecondResult();
269
			Element elContributors = doubleResult.getFirstResult();
270
			StringBuilder authorBilder = new StringBuilder();
271
			if (elContributors != null) {
272
				childName = "authors";
273
				obligatory = false;
274
				doubleResult =  XmlHelp.getSingleChildElement(elContributors, childName, tcsNamespace, obligatory);
275
				success &= doubleResult.getSecondResult();
276
				Element elAuthors = doubleResult.getFirstResult();
277
			
278
				if (elAuthors !=null){
279
					childName = "author";
280
					obligatory = false;
281
					doubleResult =  XmlHelp.getSingleChildElement(elAuthors, childName, tcsNamespace, obligatory);
282
					success &= doubleResult.getSecondResult();
283
					Element elAuthor = doubleResult.getFirstResult();
284
					if (elAuthor!=null) {
285
						String strCorp_name = elAuthor.getAttributeValue("corp-name");			
286
						String strFirst_name = elAuthor.getAttributeValue("first-name");
287
						String strInitials = elAuthor.getAttributeValue("initials");
288
						String strLast_name = elAuthor.getAttributeValue("last-name");
289
						String strMiddle_initial = elAuthor.getAttributeValue("middle-initial");
290
						String strRole = elAuthor.getAttributeValue("role");
291
						String strSalutation = elAuthor.getAttributeValue("salutation");
292
						String strSuffix = elAuthor.getAttributeValue("suffix");
293
						String strTitle = elAuthor.getAttributeValue("title");
294
						
295
						childName = "style";
296
						obligatory = false;
297
						doubleResult =  XmlHelp.getSingleChildElement(elAuthor, childName, tcsNamespace, obligatory);
298
						success &= doubleResult.getSecondResult();
299
						Element elStyle = doubleResult.getFirstResult();
300
					
301
						if (elStyle != null) {
302
							String strColor = elStyle.getAttributeValue("color");
303
							String strFace = elStyle.getAttributeValue("face");
304
							String strFont = elStyle.getAttributeValue("font");
305
							String strSize = elStyle.getAttributeValue("size");
306
							String author_style =  elStyle.getTextNormalize();
307

    
308
							reference.setAuthorTeam(authorTeam);
309
						    authorTeam.setNomenclaturalTitle(author_style);						  
310
					}
311
				}
312
			}	
313
				logger.info("start make secondary-authors ...");
314
				childName = "secondary-authors";
315
				obligatory = false;
316
				doubleResult =  XmlHelp.getSingleChildElement(elContributors, childName, tcsNamespace, obligatory);
317
				success &= doubleResult.getSecondResult();
318
				Element elSecondary_Authors = doubleResult.getFirstResult();
319
				if (elSecondary_Authors != null) {
320
					childName = "author";
321
					obligatory = false;
322
					doubleResult =  XmlHelp.getSingleChildElement(elSecondary_Authors, childName, tcsNamespace, obligatory);
323
					success &= doubleResult.getSecondResult();
324
					Element elSecondary_Author = doubleResult.getFirstResult();
325
					if (elSecondary_Author != null) {
326
						String strsecondaryCorp_name = elSecondary_Author.getAttributeValue("corp-name");
327
						String strsecondaryFirst_name = elSecondary_Author.getAttributeValue("first-name");
328
						String strsecondaryInitials = elSecondary_Author.getAttributeValue("initials");
329
						String strsecondaryLast_name = elSecondary_Author.getAttributeValue("last-name");
330
						String strsecondaryMiddle_initial = elSecondary_Author.getAttributeValue("middle-initial");
331
						String strsecondaryRole = elSecondary_Author.getAttributeValue("role");
332
						String strsecondarySalutation = elSecondary_Author.getAttributeValue("salutation");
333
						String strsecondarySuffix = elSecondary_Author.getAttributeValue("suffix");
334
						String strsecondaryTitle = elSecondary_Author.getAttributeValue("title");
335
			
336
						childName = "style";
337
						obligatory = false;
338
						doubleResult =  XmlHelp.getSingleChildElement(elSecondary_Author, childName, tcsNamespace, obligatory);
339
						success &= doubleResult.getSecondResult();
340
						Element elStyle_secondary = doubleResult.getFirstResult();
341
						if (elStyle_secondary!= null) {
342
							String strColor_secondary = elStyle_secondary.getAttributeValue("color");
343
							String strFace_secondary = elStyle_secondary.getAttributeValue("face");
344
							String strFont_secondary = elStyle_secondary.getAttributeValue("font");
345
							String strSize_secondary = elStyle_secondary.getAttributeValue("size");
346
							String  secondary_author=  elStyle_secondary.getTextNormalize();
347
 					 
348
							reference.setAuthorTeam(authorTeam);
349
							authorTeam.setTitleCache(secondary_author, true);
350
						}
351
					}
352
				}
353
				/** It was not used in this Implementation
354
				logger.info("start make tertiary-authors ...");
355
				childName = "tertiary-authors";
356
				obligatory = false;
357
				doubleResult =  XmlHelp.getSingleChildElement(elContributors, childName, tcsNamespace, obligatory);
358
				success &= doubleResult.getSecondResult();
359
				Element elTertiary_Authors = doubleResult.getFirstResult();
360
				if (elTertiary_Authors != null) {
361
			
362
					childName = "author";
363
					obligatory = false;
364
					doubleResult =  XmlHelp.getSingleChildElement(elTertiary_Authors, childName, tcsNamespace, obligatory);
365
					success &= doubleResult.getSecondResult();
366
					Element elTertiary_Author = doubleResult.getFirstResult();
367
					if (elTertiary_Author != null) {
368
						String strtertiaryCorp_name = elTertiary_Author.getAttributeValue("corp-name");
369
						String strtertiaryFirst_name = elTertiary_Author.getAttributeValue("first-name");
370
						String strtertiaryInitials = elTertiary_Author.getAttributeValue("initials");
371
						String strtertiaryLast_name = elTertiary_Author.getAttributeValue("last-name");
372
						String strtertiaryMiddle_initial = elTertiary_Author.getAttributeValue("middle-initial");
373
						String strtertiaryRole = elTertiary_Author.getAttributeValue("role");
374
						String strtertiarySalutation = elTertiary_Author.getAttributeValue("salutation");
375
						String strtertiarySuffix = elTertiary_Author.getAttributeValue("suffix");
376
						String strtertiaryTitle = elTertiary_Author.getAttributeValue("title");
377
			
378
						childName = "style";
379
						obligatory = false;
380
						doubleResult =  XmlHelp.getSingleChildElement(elTertiary_Author, childName, tcsNamespace, obligatory);
381
						success &= doubleResult.getSecondResult();
382
						Element elStyle_tertiary = doubleResult.getFirstResult();
383
						if (elStyle_tertiary != null) { 
384
							String strColor_tertiary = elStyle_tertiary.getAttributeValue("color");
385
							String strFace_tertiary = elStyle_tertiary.getAttributeValue("face");
386
							String strFont_tertiary = elStyle_tertiary.getAttributeValue("font");
387
							String strSize_tertiary = elStyle_tertiary.getAttributeValue("size");
388
						}
389
					}
390
				}
391
				logger.info("start make subsidiary-authors ...");
392
				childName = "subsidiary-authors";
393
				obligatory = false;
394
				doubleResult =  XmlHelp.getSingleChildElement(elContributors, childName, tcsNamespace, obligatory);
395
				success &= doubleResult.getSecondResult();
396
				Element elSubsidiary_Authors = doubleResult.getFirstResult();
397
				if (elSubsidiary_Authors != null) {
398
					childName = "author";
399
					obligatory = false;
400
					doubleResult =  XmlHelp.getSingleChildElement(elSubsidiary_Authors, childName, tcsNamespace, obligatory);
401
					success &= doubleResult.getSecondResult();
402
					Element elSubsidiary_Author = doubleResult.getFirstResult();
403
					if (elSubsidiary_Author !=null){
404
						String strSubsidiaryCorp_name = elSubsidiary_Author.getAttributeValue("corp-name");
405
						String strSubsidiaryFirst_name = elSubsidiary_Author.getAttributeValue("first-name");
406
						String strSubsidiaryInitials = elSubsidiary_Author.getAttributeValue("initials");
407
						String strSubsidiaryLast_name = elSubsidiary_Author.getAttributeValue("last-name");
408
						String strSubsidiaryMiddle_initial = elSubsidiary_Author.getAttributeValue("middle-initial");
409
						String strSubsidiaryRole = elSubsidiary_Author.getAttributeValue("role");
410
						String strSubsidiarySalutation = elSubsidiary_Author.getAttributeValue("salutation");
411
						String strSubsidiarySuffix = elSubsidiary_Author.getAttributeValue("suffix");
412
						String strSubsidiaryTitle = elSubsidiary_Author.getAttributeValue("title");
413
			
414
						childName = "style";
415
						obligatory = false;
416
						doubleResult =  XmlHelp.getSingleChildElement(elSubsidiary_Author, childName, tcsNamespace, obligatory);
417
						success &= doubleResult.getSecondResult();
418
						Element elStyle_Subsidiary = doubleResult.getFirstResult();
419
						if (elStyle_Subsidiary != null) {
420
							String strColor_Subsidiary = elStyle_Subsidiary.getAttributeValue("color");
421
							String strFace_Subsidiary = elStyle_Subsidiary.getAttributeValue("face");
422
							String strFont_Subsidiary = elStyle_Subsidiary.getAttributeValue("font");
423
							String strSize_Subsidiary = elStyle_Subsidiary.getAttributeValue("size");
424
						}
425
					}
426
				}
427
				logger.info("start make translated-authors ...");
428
				childName = "translated-authors";
429
				obligatory = false;
430
				doubleResult =  XmlHelp.getSingleChildElement(elContributors, childName, tcsNamespace, obligatory);
431
				success &= doubleResult.getSecondResult();
432
				Element elTranslated_Authors = doubleResult.getFirstResult();
433
				if (elTranslated_Authors != null) {
434
					childName = "author";
435
					obligatory = false;
436
					doubleResult =  XmlHelp.getSingleChildElement(elTranslated_Authors, childName, tcsNamespace, obligatory);
437
					success &= doubleResult.getSecondResult();
438
					Element elTranslated_Author = doubleResult.getFirstResult();
439
					if (elTranslated_Author !=null){
440
						String strTranslatedCorp_name = elTranslated_Author.getAttributeValue("corp-name");
441
						String strTranslatedFirst_name = elTranslated_Author.getAttributeValue("first-name");
442
						String strTranslatedInitials = elTranslated_Author.getAttributeValue("initials");
443
						String strTranslatedLast_name = elTranslated_Author.getAttributeValue("last-name");
444
						String strTranslatedMiddle_initial = elTranslated_Author.getAttributeValue("middle-initial");
445
						String strTranslatedRole = elTranslated_Author.getAttributeValue("role");
446
						String strTranslatedSalutation = elTranslated_Author.getAttributeValue("salutation");
447
						String strTranslatedSuffix = elTranslated_Author.getAttributeValue("suffix");
448
						String strTranslatedTitle = elTranslated_Author.getAttributeValue("title");
449
			
450
						childName = "style";
451
						obligatory = false;
452
						doubleResult =  XmlHelp.getSingleChildElement(elTranslated_Author, childName, tcsNamespace, obligatory);
453
						success &= doubleResult.getSecondResult();
454
						Element elStyle_Translated = doubleResult.getFirstResult();
455
						if (elStyle_Translated!= null) {
456
							String strColor_Translated = elStyle_Translated.getAttributeValue("color");
457
							String strFace_Translated = elStyle_Translated.getAttributeValue("face");
458
							String strFont_Translated = elStyle_Translated.getAttributeValue("font");
459
							String strSize_Translated = elStyle_Translated.getAttributeValue("size");
460
						}
461
					}
462
				}
463
				*/
464
			}
465
			 
466
			logger.info("start make auth-address ...");
467
			childName = "auth-address";
468
			obligatory = false;
469
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
470
			success &= doubleResult.getSecondResult();
471
			Element elAuth_address = doubleResult.getFirstResult();
472
			
473
			if (elAuth_address != null){
474
			
475
				childName = "style";
476
				obligatory = false;
477
				doubleResult =  XmlHelp.getSingleChildElement(elAuth_address, childName, tcsNamespace, obligatory);
478
				success &= doubleResult.getSecondResult();
479
				Element elStyle_address = doubleResult.getFirstResult();
480
				String strColor_address = elStyle_address.getAttributeValue("color");
481
				String strFace_address = elStyle_address.getAttributeValue("face");
482
				String strFont_address = elStyle_address.getAttributeValue("font");
483
				String strSize_address = elStyle_address.getAttributeValue("size");
484
				String address_style = elStyle_address.getTextNormalize();
485
				
486
				Contact contact =  new Contact();
487
				Address address = Address.NewInstance();
488
				reference.setAuthorTeam(authorTeam);
489
				authorTeam.setContact(contact);		 
490
				contact.addAddress(address);
491
				address.setLocality(address_style);
492
			}
493
			
494
			
495
			logger.info("start make auth-affilation ...");
496
			childName = "auth-affiliaton";
497
			obligatory = false;
498
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
499
			success &= doubleResult.getSecondResult();
500
			Element elAuth_affilation = doubleResult.getFirstResult();
501
			if (elAuth_affilation != null) {
502
				
503
				childName = "style";
504
				obligatory = false;
505
				doubleResult =  XmlHelp.getSingleChildElement(elAuth_affilation, childName, tcsNamespace, obligatory);
506
				success &= doubleResult.getSecondResult();
507
				Element elStyle_affilation = doubleResult.getFirstResult();
508
				String strColor_affilation = elStyle_affilation.getAttributeValue("color");
509
				String strFace_affilation = elStyle_affilation.getAttributeValue("face");
510
				String strFont_affilation = elStyle_affilation.getAttributeValue("font");
511
				String strSize_affilation = elStyle_affilation.getAttributeValue("size");
512
				
513
				String affilation = elStyle_affilation.getTextNormalize();
514
				reference.addExtension(affilation, ExtensionType.AREA_OF_INTREREST());
515
			}
516
				
517
			logger.info("start make titles ...");
518
			childName = "titles";
519
			obligatory = false;
520
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
521
			success &= doubleResult.getSecondResult();
522
			Element elTitles = doubleResult.getFirstResult();
523
			if (elTitles != null) {
524
		
525
				childName = "title";
526
				obligatory = false;
527
				doubleResult =  XmlHelp.getSingleChildElement(elTitles, childName, tcsNamespace, obligatory);
528
				success &= doubleResult.getSecondResult();
529
				Element elTitle = doubleResult.getFirstResult();
530
				if (elTitle != null) {
531
					
532
					childName = "style";
533
					obligatory = false;
534
					doubleResult =  XmlHelp.getSingleChildElement(elTitle, childName, tcsNamespace, obligatory);
535
					List<Element> elList = XmlHelp.getMultipleChildElement(elTitle, childName, tcsNamespace, obligatory);
536
					StringBuilder title_new = new StringBuilder();
537
					for (int a = 0; a < elList.size(); a++){
538
						doubleResult.setFirstResult(elList.get(a));
539
						doubleResult.setSecondResult(true);
540
						success &= doubleResult.getSecondResult();
541
		
542
						Element elStyle_Title = doubleResult.getFirstResult();
543
						String title = elStyle_Title.getText();			 
544
						title_new.append(title+" ");
545
				
546
						if (elStyle_Title != null) {
547
						
548
							String strColor_Title = elStyle_Title.getAttributeValue("color");
549
							String strFace_Title = elStyle_Title.getAttributeValue("face");
550
							String strFont_Title = elStyle_Title.getAttributeValue("font");
551
							String strSize_Title = elStyle_Title.getAttributeValue("size");
552
							String strName_reftype = elRef_type.getAttributeValue("name");
553
							title_new.toString();
554
							
555
							if (strName_reftype.equals("Article")) {
556
								map_article.put(title_new.toString(), (ReferenceBase) article);
557
								ReferenceBase give_article = map_article.get(title_new.toString());
558
								give_article.setTitle(title_new.toString());
559
								reference=give_article;
560
							}else if (strName_reftype.equals("Book")) {
561
								map_book.put(title_new.toString(), book);
562
								ReferenceBase give_book = map_book.get(title_new.toString());
563
								give_book.setTitle(title_new.toString());
564
								reference=give_book;
565
							}else if (strName_reftype.equals("Book Section")){
566
								map_book_section.put(title_new.toString(), bookSection);
567
								ReferenceBase give_book_section = map_book_section.get(title_new.toString());
568
								give_book_section.setTitle(title_new.toString());
569
								reference=give_book_section;
570
							}else if (strName_reftype.equalsIgnoreCase("Patent")) {
571
								map_patent.put(title_new.toString(), patent);
572
								ReferenceBase give_patent = map_patent.get(title_new.toString());
573
								give_patent.setTitle(title_new.toString());
574
								reference=give_patent;
575
							}else if (strName_reftype.equalsIgnoreCase("Personal Communication")){
576
								personalCommunication.setTitle(title_new.toString());
577
								reference=personalCommunication;
578
							}else if (strName_reftype.equalsIgnoreCase("Journal")) {
579
								map_journal.put(title_new.toString(), journal);
580
								ReferenceBase give_journal = map_journal.get(title_new.toString());
581
								give_journal.setTitle(title_new.toString());
582
								reference=give_journal;
583
							}else if (strName_reftype.equalsIgnoreCase("CdDvd")) {
584
								map_cdDvd.put(title_new.toString(), cdDvd);
585
								ReferenceBase give_cdDvd = map_cdDvd.get(title_new.toString());
586
								give_cdDvd.setTitle(title_new.toString());
587
								reference=give_cdDvd;
588
							}else if (strName_reftype.equalsIgnoreCase("Database")) {
589
								map_database.put(title_new.toString(), database);
590
								ReferenceBase give_database = map_database.get(title_new.toString());
591
								give_database.setTitle(title_new.toString());
592
								reference=give_database;
593
							}else if (strName_reftype.equalsIgnoreCase("WebPage")) {
594
								map_webPage.put(title_new.toString(), webPage);
595
								ReferenceBase give_webPage = map_webPage.get(title_new.toString());
596
								give_webPage.setTitle(title_new.toString());
597
								reference=give_webPage;
598
							}else if (strName_reftype.equalsIgnoreCase("Report")) {
599
								map_report.put(title_new.toString(), report);
600
								ReferenceBase give_report = map_report.get(title_new.toString());
601
								give_report.setTitle(title_new.toString());
602
								reference=give_report;
603
							}else if (strName_reftype.equalsIgnoreCase("Thesis")) {
604
								map_thesis.put(title_new.toString(), thesis);
605
								ReferenceBase give_thesis = map_thesis.get(title_new.toString());
606
								give_thesis.setTitle(title_new.toString());
607
								reference=give_thesis;
608
							}else if (strName_reftype.equalsIgnoreCase("Print Series")){
609
								map_printSeries.put(title_new.toString(), printSeries);
610
								ReferenceBase give_printSeries = map_printSeries.get(title_new.toString());
611
								give_printSeries.setTitle(title_new.toString());
612
							}else if (strName_reftype.equals("Journal Article")){
613
								map_article.put(title_new.toString(), article);
614
								ReferenceBase give_article = map_article.get(title_new.toString());
615
								give_article.setTitle(title_new.toString());
616
								reference=give_article;
617
							}else if (strName_reftype.equalsIgnoreCase("Conference Proceedings")){
618
								map_proceedings.put(title_new.toString(), proceedings);
619
								ReferenceBase give_proceedings = map_proceedings.get(title_new.toString());
620
								give_proceedings.setTitle(title_new.toString());
621
								reference=give_proceedings;
622
							}else {
623
								logger.warn("The type was not found...");
624
								map_generic.put(title_new.toString(), generic);
625
								ReferenceBase give_generic = map_generic.get(title_new.toString());
626
								give_generic.setTitle(title_new.toString());
627
								reference=give_generic;
628
								success = false; 
629
							}		 
630
						}
631
					}
632
				}
633
			
634
				childName = "secondary-title";
635
				obligatory = false;
636
				doubleResult =  XmlHelp.getSingleChildElement(elTitles, childName, tcsNamespace, obligatory);
637
				success &= doubleResult.getSecondResult();
638
				Element elSecondary_title = doubleResult.getFirstResult();
639
				if (elSecondary_title!=null) {
640
					childName = "style";
641
					obligatory = false;
642
					doubleResult =  XmlHelp.getSingleChildElement(elSecondary_title, childName, tcsNamespace, obligatory);
643
					success &= doubleResult.getSecondResult();
644
					Element elStyle_Secondary_title = doubleResult.getFirstResult();
645
					if (elStyle_Secondary_title != null) {
646
						String strColor_Secondary_title = elStyle_Secondary_title.getAttributeValue("color");
647
						String strFace_Secondary_title = elStyle_Secondary_title.getAttributeValue("face");
648
						String strFont_Secondary_title = elStyle_Secondary_title.getAttributeValue("font");
649
						String strSize_Secondary_title = elStyle_Secondary_title.getAttributeValue("size");
650
						String strName_reftype = elRef_type.getAttributeValue("name");
651
						String secondary_title = elStyle_Secondary_title.getTextNormalize();
652
						 
653
						if (strName_reftype.equals("Book Section")){
654
				    		if (secondary_title != null) {
655
				    			ReferenceBase give_book =map_book.get(secondary_title);
656
				    			if (give_book!= null) {
657
				    				bookSection.setInBook(give_book);
658
				    				give_book.setTitle(secondary_title);
659
				    			} else {
660
				    				bookSection.setInBook(book);
661
				    				map_book.put(secondary_title, book);
662
				    				book.setTitle(secondary_title);
663
				    			}
664
				    			reference=bookSection;
665
				    		}
666
				    	}else {
667
							logger.warn("The type was not found...");
668
							map_generic.put(secondary_title, generic);
669
							ReferenceBase give_generic = map_generic.get(secondary_title);
670
							give_generic.setTitle(secondary_title);
671
							reference=give_generic;
672
							success = false; 
673
						}						
674
					}
675
				}
676
				
677
				/** It was not used in this Implementation
678
				childName = "tertiary-title";
679
				obligatory = false;
680
				doubleResult =  XmlHelp.getSingleChildElement(elTitles, childName, tcsNamespace, obligatory);
681
				success &= doubleResult.getSecondResult();
682
				Element elTertiary_title = doubleResult.getFirstResult();
683
				if (elTertiary_title != null){
684
					childName = "style";
685
					obligatory = false;
686
					doubleResult =  XmlHelp.getSingleChildElement(elTertiary_title, childName, tcsNamespace, obligatory);
687
					success &= doubleResult.getSecondResult();
688
					Element elStyle_Tertiary_title = doubleResult.getFirstResult();
689
					if (elStyle_Tertiary_title != null) {
690
						String strColor_Tertiary_title = elStyle_Tertiary_title.getAttributeValue("color");
691
						String strFace_Tertiary_title = elStyle_Tertiary_title.getAttributeValue("face");
692
						String strFont_Tertiary_title = elStyle_Tertiary_title.getAttributeValue("font");
693
						String strSize_Tertiary_title = elStyle_Tertiary_title.getAttributeValue("size");
694
					}
695
				}
696
				childName = "alt-title";
697
				obligatory = false;
698
				doubleResult =  XmlHelp.getSingleChildElement(elTitles, childName, tcsNamespace, obligatory);
699
				success &= doubleResult.getSecondResult();
700
				Element elAlt_title = doubleResult.getFirstResult();
701
				if (elAlt_title != null) {
702
					childName = "style";
703
					obligatory = false;
704
					doubleResult =  XmlHelp.getSingleChildElement(elAlt_title, childName, tcsNamespace, obligatory);
705
					success &= doubleResult.getSecondResult();
706
					Element elStyle_Alt_title = doubleResult.getFirstResult();
707
					if (elStyle_Alt_title != null) {
708
						String strColor_Alt_title = elStyle_Alt_title.getAttributeValue("color");
709
						String strFace_Alt_title = elStyle_Alt_title.getAttributeValue("face");
710
						String strFont_Alt_title = elStyle_Alt_title.getAttributeValue("font");
711
						String strSize_Alt_title = elStyle_Alt_title.getAttributeValue("size");
712
					}
713
				}
714
				childName = "short-title";
715
				obligatory = false;
716
				doubleResult =  XmlHelp.getSingleChildElement(elTitles, childName, tcsNamespace, obligatory);
717
				success &= doubleResult.getSecondResult();
718
				Element elShort_title = doubleResult.getFirstResult();
719
				if (elShort_title != null) {
720
					
721
					childName = "style";
722
					obligatory = false;
723
					doubleResult =  XmlHelp.getSingleChildElement(elShort_title, childName, tcsNamespace, obligatory);
724
					success &= doubleResult.getSecondResult();
725
					Element elStyle_Short_title = doubleResult.getFirstResult();
726
					if (elStyle_Short_title != null) {
727
						String strColor_Short_title = elStyle_Short_title.getAttributeValue("color");
728
						String strFace_Short_title = elStyle_Short_title.getAttributeValue("face");
729
						String strFont_Short_title = elStyle_Short_title.getAttributeValue("font");
730
						String strSize_Short_title = elStyle_Short_title.getAttributeValue("size");
731
					}
732
				}
733
				
734
				childName = "translated-title";
735
				obligatory = false;
736
				doubleResult =  XmlHelp.getSingleChildElement(elTitles, childName, tcsNamespace, obligatory);
737
				success &= doubleResult.getSecondResult();
738
				Element elTranslated_title = doubleResult.getFirstResult();
739
				if (elTranslated_title != null) {
740
			
741
					childName = "style";
742
					obligatory = false;
743
					doubleResult =  XmlHelp.getSingleChildElement(elTranslated_title, childName, tcsNamespace, obligatory);
744
					success &= doubleResult.getSecondResult();
745
					Element elStyle_Translated_title = doubleResult.getFirstResult();
746
					if (elStyle_Translated_title != null) {
747
						String strColor_Translated_title = elStyle_Translated_title.getAttributeValue("color");
748
						String strFace_Translated_title = elStyle_Translated_title.getAttributeValue("face");
749
						String strFont_Translated_title = elStyle_Translated_title.getAttributeValue("font");
750
						String strSize_Translated_title = elStyle_Translated_title.getAttributeValue("size");
751
					}
752
				}
753
			*/
754
			}
755
		 
756
			logger.info("start make periodical ...");
757
			childName = "periodical";
758
			obligatory = false;
759
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
760
			success &= doubleResult.getSecondResult();
761
			Element elPeriodical = doubleResult.getFirstResult();
762
			if (elPeriodical != null) {
763
				
764
				childName = "full-title";
765
				obligatory = false;
766
				doubleResult =  XmlHelp.getSingleChildElement(elPeriodical, childName, tcsNamespace, obligatory);
767
				success &= doubleResult.getSecondResult();
768
				Element elFull_title = doubleResult.getFirstResult();
769
			    if (elFull_title != null) {
770
			    	
771
			    	childName = "style";
772
			    	obligatory = false;
773
			    	doubleResult =  XmlHelp.getSingleChildElement(elFull_title, childName, tcsNamespace, obligatory);
774
			    	success &= doubleResult.getSecondResult();
775
			    	Element elStyle_Full_title = doubleResult.getFirstResult();
776
			    	String strColor_Full_title = elStyle_Full_title.getAttributeValue("color");
777
			    	String strFace_Full_title = elStyle_Full_title.getAttributeValue("face");
778
			    	String strFont_Full_title = elStyle_Full_title.getAttributeValue("font");
779
			    	String strSize_Full_title = elStyle_Full_title.getAttributeValue("size");
780
			    	
781
			    	String strName_reftype = elRef_type.getAttributeValue("name");
782
			    	String periodical = elStyle_Full_title.getTextNormalize();
783
			    	
784
			    	if (strName_reftype.equals("Journal Article")){		    		
785
			    		
786
			    		if (periodical != null) {	    			 	
787
			    			ReferenceBase give_journal = map_journal.get(periodical);
788
							if (give_journal!= null) {
789
								article.setInJournal(give_journal);	
790
								give_journal.setTitle(periodical);
791
							} else {
792
								article.setInJournal(journal);		 
793
								map_journal.put(periodical, journal);
794
								journal.setTitle(periodical);
795
							}
796
							reference=article;
797
			    		}
798
			    	} else {
799
						logger.warn("The type was not found...");
800
						success = false;
801
					}		 	
802
			    }
803
			     
804
			    /** It was not used in this Implementation
805
			    childName = "abbr-1";
806
			    obligatory = false;
807
			    doubleResult =  XmlHelp.getSingleChildElement(elPeriodical, childName, tcsNamespace, obligatory);
808
			    success &= doubleResult.getSecondResult();
809
			    Element elAbbr_1 = doubleResult.getFirstResult();
810
			    if (elAbbr_1 != null) {
811
		
812
			    	childName = "style";
813
			    	obligatory = false;
814
			    	doubleResult =  XmlHelp.getSingleChildElement(elAbbr_1, childName, tcsNamespace, obligatory);
815
			    	success &= doubleResult.getSecondResult();
816
			    	Element elStyle_Abbr_1 = doubleResult.getFirstResult();
817
			    	String strColor_Abbr_1 = elStyle_Abbr_1.getAttributeValue("color");
818
			    	String strFace_Abbr_1 = elStyle_Abbr_1.getAttributeValue("face");
819
			    	String strFont_Abbr_1 = elStyle_Abbr_1.getAttributeValue("font");
820
			    	String strSize_Abbr_1 = elStyle_Abbr_1.getAttributeValue("size");
821
			    }
822
			    
823
			    childName = "abbr-2";
824
			    obligatory = false;
825
			    doubleResult =  XmlHelp.getSingleChildElement(elPeriodical, childName, tcsNamespace, obligatory);
826
			    success &= doubleResult.getSecondResult();
827
			    Element elAbbr_2 = doubleResult.getFirstResult();
828
			    if (elAbbr_2 != null) {
829
		
830
			    	childName = "style";
831
			    	obligatory = false;
832
			    	doubleResult =  XmlHelp.getSingleChildElement(elAbbr_2, childName, tcsNamespace, obligatory);
833
			    	success &= doubleResult.getSecondResult();
834
			    	Element elStyle_Abbr_2 = doubleResult.getFirstResult();
835
			    	String strColor_Abbr_2 = elStyle_Abbr_2.getAttributeValue("color");
836
			    	String strFace_Abbr_2 = elStyle_Abbr_2.getAttributeValue("face");
837
			    	String strFont_Abbr_2 = elStyle_Abbr_2.getAttributeValue("font");
838
			    	String strSize_Abbr_2 = elStyle_Abbr_2.getAttributeValue("size");
839
			    }
840
			    
841
			    childName = "abbr_3";
842
			    obligatory = false;
843
			    doubleResult =  XmlHelp.getSingleChildElement(elPeriodical, childName, tcsNamespace, obligatory);
844
			    success &= doubleResult.getSecondResult();
845
			    Element elAbbr_3 = doubleResult.getFirstResult();
846
			    if (elAbbr_3 != null) {
847
		
848
			    	childName = "style";
849
			    	obligatory = false;
850
			    	doubleResult =  XmlHelp.getSingleChildElement(elAbbr_3, childName, tcsNamespace, obligatory);
851
			    	success &= doubleResult.getSecondResult();
852
			    	Element elStyle_Abbr_3 = doubleResult.getFirstResult();
853
			    	String strColor_Abbr_3 = elStyle_Abbr_3.getAttributeValue("color");
854
			    	String strFace_Abbr_3 = elStyle_Abbr_3.getAttributeValue("face");
855
			    	String strFont_Abbr_3 = elStyle_Abbr_3.getAttributeValue("font");
856
			    	String strSize_Abbr_3 = elStyle_Abbr_3.getAttributeValue("size");
857
			    }
858
			*/
859
			}
860
			
861
			logger.info("start make pages ...");
862
			childName = "pages";
863
			obligatory = false;
864
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
865
			success &= doubleResult.getSecondResult();
866
			Element elPages = doubleResult.getFirstResult();
867
			if (elPages != null) {
868
				String strEnd = elPages.getAttributeValue("end");
869
				String strStart = elPages.getAttributeValue("start");
870
			
871
				childName = "style";
872
				obligatory = false;
873
				doubleResult =  XmlHelp.getSingleChildElement(elPages, childName, tcsNamespace, obligatory);
874
				success &= doubleResult.getSecondResult();
875
				Element elStyle_Pages = doubleResult.getFirstResult();
876
				String strColor_Pages = elStyle_Pages.getAttributeValue("color");
877
				String strFace_Pages = elStyle_Pages.getAttributeValue("face");
878
				String strFont_Pages = elStyle_Pages.getAttributeValue("font");
879
				String strSize_Pages = elStyle_Pages.getAttributeValue("size");
880
			
881
				String strName_reftype = elRef_type.getAttributeValue("name");
882
				String page = elStyle_Pages.getTextNormalize();
883
				 
884
				if (strName_reftype.equals("Journal Article")) {
885
					map_article.put(page, article);
886
					ReferenceBase give_article = map_article.get(page);
887
					give_article.setPages(page);
888
					reference = give_article;
889
				}else if (strName_reftype.equals("Article")){
890
					map_article.put(page, article);
891
					ReferenceBase give_article = map_article.get(page);
892
					give_article.setPages(page);
893
					reference = give_article;		
894
				}else if (strName_reftype.equals("Book")){
895
					map_book.put(page, book);
896
					ReferenceBase give_book = map_book.get(page);
897
					give_book.setPages(page);
898
					reference=give_book; 
899
				}else if (strName_reftype.equals("Book Section")){
900
					map_book_section.put(page, bookSection);
901
					ReferenceBase give_book_section = map_book_section.get(page);
902
					give_book_section.setPages(page);
903
					reference=give_book_section;
904
				}else if (strName_reftype.equalsIgnoreCase("Conference Proceedings")){
905
					map_proceedings.put(page, proceedings);
906
					ReferenceBase give_proceedings = map_proceedings.get(page);
907
					give_proceedings.setPages(page);
908
					reference=give_proceedings;	
909
				} else {
910
					logger.warn("The type was not found...");
911
					map_generic.put(page, generic);
912
					ReferenceBase give_generic  = map_generic.get(page);
913
					give_generic.setPages(page);
914
					reference =give_generic; 
915
					success = false;			
916
				}		 	
917
			}
918
			
919
			logger.info("start make volume ...");
920
			childName = "volume";
921
			obligatory = false;
922
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
923
			success &= doubleResult.getSecondResult();
924
			Element elVolume = doubleResult.getFirstResult();
925
			if (elVolume != null) {
926
				childName = "style";
927
				obligatory = false;
928
				doubleResult =  XmlHelp.getSingleChildElement(elVolume, childName, tcsNamespace, obligatory);
929
				success &= doubleResult.getSecondResult();
930
				Element elStyle_Volume = doubleResult.getFirstResult();
931
				String strColor_Volume = elStyle_Volume.getAttributeValue("color");
932
				String strFace_Volume = elStyle_Volume.getAttributeValue("face");
933
				String strFont_Volume = elStyle_Volume.getAttributeValue("font");
934
				String strSize_Volume = elStyle_Volume.getAttributeValue("size");
935
				
936
				String strName_reftype = elRef_type.getAttributeValue("name");
937
				String volume = elStyle_Volume.getTextNormalize();
938
				
939
				if (strName_reftype.equals("Journal Article")) {
940
					map_article.put(volume, article);
941
					ReferenceBase give_article = map_article.get(volume);
942
					give_article.setVolume(volume);
943
					reference = give_article;
944
				}else if (strName_reftype.equals("Article")){
945
					map_article.put(volume, article);
946
					ReferenceBase give_article = map_article.get(volume);
947
					give_article.setVolume(volume);
948
					reference = give_article;
949
				}else if (strName_reftype.equals("Book")){
950
					map_book.put(volume, book);
951
					ReferenceBase give_book = map_book.get(volume);
952
					give_book.setVolume(volume);
953
					reference=give_book; 
954
				}else if (strName_reftype.equals("Book Section")){
955
					 if (volume != null) {
956
						 bookSection.setInBook(book);
957
						 book.setVolume(volume);
958
						 reference= bookSection;
959
					 }
960
				}else if (strName_reftype.equalsIgnoreCase("Conference Proceedings")){
961
					map_proceedings.put(volume, proceedings);
962
					ReferenceBase give_proceedings = map_proceedings.get(volume);
963
					give_proceedings.setVolume(volume);
964
					reference=give_proceedings;
965
				}else{	
966
					logger.warn("The type was not found...");
967
					map_generic.put(volume, generic);
968
					ReferenceBase give_generic  = map_generic.get(volume);
969
					give_generic.setVolume(volume);
970
					reference =give_generic; 
971
					success = true;
972
				}		 	
973
			}
974
			 
975
			logger.info("start make number ...");
976
			childName = "number"; // In CDM it's "Series"
977
			obligatory = false;
978
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
979
			success &= doubleResult.getSecondResult();
980
			Element elNumber = doubleResult.getFirstResult();
981
			if (elNumber != null) {
982
		
983
				childName = "style";
984
				obligatory = false;
985
				doubleResult =  XmlHelp.getSingleChildElement(elNumber, childName, tcsNamespace, obligatory);
986
				success &= doubleResult.getSecondResult();
987
				Element elStyle_Number = doubleResult.getFirstResult();
988
				String strColor_Number = elStyle_Number.getAttributeValue("color");
989
				String strFace_Number = elStyle_Number.getAttributeValue("face");
990
				String strFont_Number = elStyle_Number.getAttributeValue("font");
991
				String strSize_Number = elStyle_Number.getAttributeValue("size");
992
				
993
				String strName_reftype = elRef_type.getAttributeValue("name");
994
				String number = elStyle_Number.getTextNormalize();
995
				
996
				if (strName_reftype.equals("Journal Article")) {
997
					map_article.put(number, article);
998
					ReferenceBase give_article = map_article.get(number);
999
					give_article.setSeries(number);
1000
					reference = give_article;
1001
				}else if (strName_reftype.equals("Article")){
1002
					map_article.put(number, article);
1003
					ReferenceBase give_article = map_article.get(number);
1004
					give_article.setSeries(number);
1005
					reference = give_article;
1006
				}else {			 
1007
					logger.warn("The type was not found...");
1008
					map_generic.put(number, generic);
1009
					ReferenceBase give_generic  = map_generic.get(number);
1010
					give_generic.setSeries(number);
1011
					reference =give_generic;
1012
					success = false;
1013
				}		 		
1014
			}
1015
			
1016
			/**
1017
			// NOT USE IN THE IMPLEMENTATION	
1018
			childName = "issue"; // not use in CDM
1019
			obligatory = false;
1020
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1021
			success &= doubleResult.getSecondResult();
1022
			Element elIssue = doubleResult.getFirstResult();
1023
			if (elIssue != null) {
1024
			
1025
				childName = "style";
1026
				obligatory = false;
1027
				doubleResult =  XmlHelp.getSingleChildElement(elIssue, childName, tcsNamespace, obligatory);
1028
				success &= doubleResult.getSecondResult();
1029
				Element elStyle_Issue = doubleResult.getFirstResult();
1030
				String strColor_Issue = elStyle_Issue.getAttributeValue("color");
1031
				String strFace_Issue = elStyle_Issue.getAttributeValue("face");
1032
				String strFont_Issue = elStyle_Issue.getAttributeValue("font");
1033
				String strSize_Issue = elStyle_Issue.getAttributeValue("size");
1034
			}
1035
			
1036
			// LIKE NUMBER ELEMENT (the same content) use very selten
1037
			//Amount Received - the name in Endnote Programm
1038
			childName = "num-vols"; // not use in CDM
1039
			obligatory = false;
1040
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1041
			success &= doubleResult.getSecondResult();
1042
			Element elNum_vols = doubleResult.getFirstResult();
1043
			if (elNum_vols != null) {
1044
				childName = "style";
1045
				obligatory = false;
1046
				doubleResult =  XmlHelp.getSingleChildElement(elNum_vols, childName, tcsNamespace, obligatory);
1047
				success &= doubleResult.getSecondResult();
1048
				Element elStyle_Num_vols = doubleResult.getFirstResult();
1049
				String strColor_Num_vols = elStyle_Num_vols.getAttributeValue("color");
1050
				String strFace_Num_vols = elStyle_Num_vols.getAttributeValue("face");
1051
				String strFont_Num_vols = elStyle_Num_vols.getAttributeValue("font");
1052
				String strSize_Num_vols = elStyle_Num_vols.getAttributeValue("size");
1053
			}
1054
			*/
1055
			
1056
			logger.info("start make edition ...");
1057
			childName = "edition";
1058
			obligatory = false;
1059
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1060
			success &= doubleResult.getSecondResult();
1061
			Element elEdition = doubleResult.getFirstResult();
1062
			if (elEdition != null) {
1063
				childName = "style";
1064
				obligatory = false;
1065
				doubleResult =  XmlHelp.getSingleChildElement(elEdition, childName, tcsNamespace, obligatory);
1066
				success &= doubleResult.getSecondResult();
1067
				Element elStyle_Edition = doubleResult.getFirstResult();
1068
				String strColor_Edition = elStyle_Edition.getAttributeValue("color");
1069
				String strFace_Edition = elStyle_Edition.getAttributeValue("face");
1070
				String strFont_Edition = elStyle_Edition.getAttributeValue("font");
1071
				String strSize_Edition = elStyle_Edition.getAttributeValue("size");
1072
				
1073
				String strName_reftype = elRef_type.getAttributeValue("name");
1074
				String edition = elStyle_Edition.getTextNormalize();
1075
				
1076
				if (strName_reftype.equals("Book")) {
1077
					map_book.put(edition, book);
1078
					ReferenceBase give_book = map_book.get(edition);
1079
					give_book.setEdition(edition);
1080
					reference=give_book; 
1081
				}else if (strName_reftype.equals("Book Section")) {
1082
					bookSection.setInBook(book);
1083
					book.setEdition(edition);
1084
					reference=bookSection; 
1085
				}else {
1086
					logger.warn("The type was not found...");
1087
					success = false;
1088
				}
1089
			}
1090
			
1091
			/**It was not used in this Implementation
1092
			// LIKE NUMBER ELEMENT (the same content) use very selten
1093
			childName = "section";
1094
			obligatory = false;
1095
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1096
			success &= doubleResult.getSecondResult();
1097
			Element elSection = doubleResult.getFirstResult();
1098
			if (elSection != null) {
1099
				childName = "style";
1100
				obligatory = false;
1101
				doubleResult =  XmlHelp.getSingleChildElement(elSection, childName, tcsNamespace, obligatory);
1102
				success &= doubleResult.getSecondResult();
1103
				Element elStyle_Section = doubleResult.getFirstResult();
1104
				String strColor_Section = elStyle_Section.getAttributeValue("color");
1105
				String strFace_Section = elStyle_Section.getAttributeValue("face");
1106
				String strFont_Section = elStyle_Section.getAttributeValue("font");
1107
				String strSize_Section = elStyle_Section.getAttributeValue("size");
1108
			}
1109
			
1110
			// NOT USE IN THE IMPLEMENTATION
1111
			childName = "reprint-edition";
1112
			obligatory = false;
1113
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1114
			success &= doubleResult.getSecondResult();
1115
			Element elReprint_edition = doubleResult.getFirstResult();
1116
			if (elReprint_edition != null) {
1117
			
1118
				childName = "style";
1119
				obligatory = false;
1120
				doubleResult =  XmlHelp.getSingleChildElement(elReprint_edition, childName, tcsNamespace, obligatory);
1121
				success &= doubleResult.getSecondResult();
1122
				Element elStyle_Reprint_edition = doubleResult.getFirstResult();
1123
				String strColor_Reprint_edition = elStyle_Reprint_edition.getAttributeValue("color");
1124
				String strFace_Reprint_edition = elStyle_Reprint_edition.getAttributeValue("face");
1125
				String strFont_Reprint_edition = elStyle_Reprint_edition.getAttributeValue("font");
1126
				String strSize_Reprint_edition = elStyle_Reprint_edition.getAttributeValue("size");
1127
			}
1128
			
1129
			// use very selten keywords use multiple keyword elements
1130
			childName = "keywords";
1131
			obligatory = false;
1132
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1133
			success &= doubleResult.getSecondResult();
1134
			Element elKeywords = doubleResult.getFirstResult();
1135
			if (elKeywords != null) {
1136
			
1137
				childName = "keyword";
1138
				obligatory = false;
1139
				doubleResult =  XmlHelp.getSingleChildElement(elKeywords, childName, tcsNamespace, obligatory);
1140
				success &= doubleResult.getSecondResult();
1141
				Element elKeyword = doubleResult.getFirstResult();
1142
				if (elKeyword != null) {
1143
					childName = "style";
1144
					obligatory = false;
1145
					doubleResult =  XmlHelp.getSingleChildElement(elKeyword, childName, tcsNamespace, obligatory);
1146
					success &= doubleResult.getSecondResult();
1147
					Element elStyle_Keyword = doubleResult.getFirstResult();
1148
					String strColor_Keyword = elStyle_Keyword.getAttributeValue("color");
1149
					String strFace_Keyword = elStyle_Keyword.getAttributeValue("face");
1150
					String strFont_Keyword = elStyle_Keyword.getAttributeValue("font");
1151
					String strSize_Keyword = elStyle_Keyword.getAttributeValue("size");
1152
				}
1153
			}
1154
			*/	
1155
			
1156
			childName = "dates";
1157
			obligatory = false;
1158
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1159
			success &= doubleResult.getSecondResult();
1160
			Element elDates = doubleResult.getFirstResult();
1161
			if (elDates != null) {
1162
				
1163
				childName = "year";
1164
				obligatory = false;
1165
				doubleResult =  XmlHelp.getSingleChildElement(elDates, childName, tcsNamespace, obligatory);
1166
				success &= doubleResult.getSecondResult();
1167
				Element elYear = doubleResult.getFirstResult();
1168
				if (elYear != null) {
1169
					String strDay = elYear.getAttributeValue("day");
1170
					String strJulian = elYear.getAttributeValue("julian");
1171
					String strMonth = elYear.getAttributeValue("month");
1172
					String strYear = elYear.getAttributeValue("year");
1173
		
1174
					childName = "style";
1175
					obligatory = false;
1176
					doubleResult =  XmlHelp.getSingleChildElement(elYear, childName, tcsNamespace, obligatory);
1177
					success &= doubleResult.getSecondResult();
1178
					Element elStyle_Year = doubleResult.getFirstResult();
1179
					String strColor_Year = elStyle_Year.getAttributeValue("color");
1180
					String strFace_Year = elStyle_Year.getAttributeValue("face");
1181
					String strFont_Year = elStyle_Year.getAttributeValue("font");
1182
					String strSize_Year = elStyle_Year.getAttributeValue("size");
1183
					
1184
					String year = elStyle_Year.getText();
1185
					reference.setDatePublished(ImportHelper.getDatePublished(year));
1186
					
1187
				}
1188
					
1189
				logger.info("start make pub-dates ...");	 
1190
				childName = "pub-dates";  //deadline - the name in Endnote Programm
1191
				obligatory = false;
1192
				doubleResult =  XmlHelp.getSingleChildElement(elDates, childName, tcsNamespace, obligatory);
1193
				success &= doubleResult.getSecondResult();
1194
				Element elPub_dates = doubleResult.getFirstResult();
1195
				if (elPub_dates != null) {
1196
					
1197
					childName = "date";
1198
					obligatory = false;
1199
					doubleResult =  XmlHelp.getSingleChildElement(elPub_dates, childName, tcsNamespace, obligatory);
1200
					success &= doubleResult.getSecondResult();
1201
					Element elDate = doubleResult.getFirstResult();
1202
					if (elDate != null){
1203
					
1204
					childName = "style";
1205
					obligatory = false;
1206
					doubleResult =  XmlHelp.getSingleChildElement(elDate, childName, tcsNamespace, obligatory);
1207
					success &= doubleResult.getSecondResult();
1208
					Element elStyle_Date = doubleResult.getFirstResult();
1209
					String strColor_Date = elStyle_Date.getAttributeValue("color");
1210
					String strFace_Date = elStyle_Date.getAttributeValue("face");
1211
					String strFont_Date = elStyle_Date.getAttributeValue("font");
1212
					String strSize_Date = elStyle_Date.getAttributeValue("size");
1213
					
1214
					String year = elStyle_Date.getText();
1215
					reference.setDatePublished(ImportHelper.getDatePublished(year));
1216
					}
1217
				}
1218
			}
1219
			
1220
			logger.info("start make pub-location ...");
1221
		 	childName = "pub-location"; // activity location - the name in Endnote Programm
1222
		 	obligatory = false;
1223
		 	doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1224
		 	success &= doubleResult.getSecondResult();
1225
		 	Element elPub_location = doubleResult.getFirstResult();
1226
		 	if (elPub_location != null) {
1227
		 	
1228
		 		childName = "style";
1229
		 		obligatory = false;
1230
		 		doubleResult =  XmlHelp.getSingleChildElement(elPub_location, childName, tcsNamespace, obligatory);
1231
		 		success &= doubleResult.getSecondResult();
1232
		 		Element elStyle_Pub_location = doubleResult.getFirstResult();
1233
		 		String strColor_Pub_location = elStyle_Pub_location.getAttributeValue("color");
1234
		 		String strFace_Pub_location = elStyle_Pub_location.getAttributeValue("face");
1235
		 		String strFont_Pub_location = elStyle_Pub_location.getAttributeValue("font");
1236
		 		String strSize_Pub_location = elStyle_Pub_location.getAttributeValue("size");
1237
		 		
1238
		 		String place = elStyle_Pub_location.getTextNormalize();
1239
		 		String strName_reftype = elRef_type.getAttributeValue("name");
1240
				 	 			
1241
				if (strName_reftype.equals("Report")) {
1242
					map_report.put(place, report);
1243
					ReferenceBase give_report = map_report.get(place);
1244
					give_report.setPlacePublished(place);
1245
					reference=give_report;
1246
				}else if (strName_reftype.equals("Book")){
1247
					map_book.put(place, book);
1248
					ReferenceBase give_book = map_book.get(place);
1249
					give_book.setPlacePublished(place);
1250
					reference=give_book;
1251
				}else if (strName_reftype.equals("Thesis")){
1252
					map_thesis.put(place, thesis);
1253
					ReferenceBase give_thesis = map_thesis.get(place);
1254
					give_thesis.setPlacePublished(place);
1255
					reference=give_thesis;
1256
				}else if (strName_reftype.equalsIgnoreCase("Conference Proceedings")){
1257
					map_proceedings.put(place, proceedings);
1258
					ReferenceBase give_proceedings = map_proceedings.get(place);
1259
					give_proceedings.setPlacePublished(place);
1260
					reference=give_proceedings;
1261
				}else if (strName_reftype.equalsIgnoreCase("Database")){
1262
					map_database.put(place, database);
1263
					ReferenceBase give_database = map_database.get(place);
1264
					give_database.setPlacePublished(place);
1265
					reference=give_database;
1266
				}else if (strName_reftype.equalsIgnoreCase("CdDvd")){
1267
					map_cdDvd.put(place, cdDvd);
1268
					ReferenceBase give_cdDvd = map_cdDvd.get(place);
1269
					give_cdDvd.setPlacePublished(place);
1270
					reference=give_cdDvd;
1271
				}else if (strName_reftype.equalsIgnoreCase("Print Series")){
1272
					map_printSeries.put(place, printSeries);
1273
					ReferenceBase give_printSeries = map_printSeries.get(place);
1274
					give_printSeries.setPlacePublished(place);
1275
					reference=give_printSeries;
1276
				}else if (strName_reftype.equalsIgnoreCase("Journal")){
1277
					map_journal.put(place, journal);
1278
					ReferenceBase give_journal = map_journal.get(place);
1279
					give_journal.setPlacePublished(place);
1280
					reference=give_journal;			
1281
				} else {
1282
					logger.warn("The type was not found...");
1283
					map_generic.put(place, generic);
1284
					ReferenceBase give_generic = map_generic.get(place);
1285
					give_generic.setPlacePublished(place);
1286
					reference=give_generic;
1287
					success = false;
1288
				}		 	
1289
		 	}
1290
		 	 
1291
			logger.info("start make publisher ...");
1292
			childName = "publisher";
1293
			obligatory = false;
1294
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1295
			success &= doubleResult.getSecondResult();
1296
			Element elPublisher = doubleResult.getFirstResult();
1297
			if (elPublisher != null) {
1298
			
1299
				childName = "style";
1300
				obligatory = false;
1301
				doubleResult =  XmlHelp.getSingleChildElement(elPublisher, childName, tcsNamespace, obligatory);
1302
				success &= doubleResult.getSecondResult();
1303
				Element elStyle_Publisher = doubleResult.getFirstResult();
1304
				String strColor_Publisher = elStyle_Publisher.getAttributeValue("color");
1305
				String strFace_Publisher = elStyle_Publisher.getAttributeValue("face");
1306
				String strFont_Publisher = elStyle_Publisher.getAttributeValue("font");
1307
				String strSize_Publisher = elStyle_Publisher.getAttributeValue("size");
1308
				
1309
				String publisher = elStyle_Publisher.getTextNormalize();
1310
				String strName_reftype = elRef_type.getAttributeValue("name");
1311
				
1312
				if (strName_reftype.equals("Report")) {
1313
					map_report.put(publisher, report);
1314
					ReferenceBase give_report = map_report.get(publisher);
1315
					give_report.setPublisher(publisher);
1316
					reference=give_report;
1317
				}else if (strName_reftype.equals("Book")){
1318
					map_book.put(publisher, book);
1319
					ReferenceBase give_book = map_book.get(publisher);
1320
					give_book.setPublisher(publisher);
1321
					reference=give_book;
1322
				}else if (strName_reftype.equals("Book Section")){
1323
					if (publisher != null) {
1324
						bookSection.setInBook(book);
1325
						book.setPublisher(publisher);
1326
						reference= bookSection;
1327
					}
1328
				}else if (strName_reftype.equals("Thesis")){
1329
					map_thesis.put(publisher, thesis);
1330
					ReferenceBase give_thesis = map_thesis.get(publisher);
1331
					give_thesis.setPublisher(publisher);
1332
					reference=give_thesis;
1333
				}else if (strName_reftype.equalsIgnoreCase("Conference Proceedings")){
1334
					map_proceedings.put(publisher, proceedings);
1335
					ReferenceBase give_proceedings = map_proceedings.get(publisher);
1336
					give_proceedings.setPublisher(publisher);
1337
					reference=give_proceedings;
1338
				}else if (strName_reftype.equalsIgnoreCase("Database")){
1339
					map_database.put(publisher, database);
1340
					ReferenceBase give_database = map_database.get(publisher);
1341
					give_database.setPublisher(publisher);
1342
					reference=give_database;
1343
				}else if (strName_reftype.equalsIgnoreCase("CdDvd")){
1344
					map_cdDvd.put(publisher, cdDvd);
1345
					ReferenceBase give_cdDvd = map_cdDvd.get(publisher);
1346
					give_cdDvd.setPublisher(publisher);
1347
					reference=give_cdDvd;
1348
				}else if (strName_reftype.equalsIgnoreCase("Print Series")){
1349
					map_printSeries.put(publisher, printSeries);
1350
					ReferenceBase give_printSeries = map_printSeries.get(publisher);
1351
					give_printSeries.setPublisher(publisher);
1352
					reference=give_printSeries;
1353
				}else if (strName_reftype.equalsIgnoreCase("Journal")){
1354
					map_journal.put(publisher, journal);
1355
					ReferenceBase give_journal = map_journal.get(publisher);
1356
					give_journal.setPublisher(publisher);
1357
					reference=give_journal;
1358
				}else if (strName_reftype.equalsIgnoreCase("Journal Article")){
1359
					if (publisher != null) {
1360
						article.setInJournal(journal);
1361
						journal.setPublisher(publisher);
1362
						reference= article;
1363
					}
1364
				} else {
1365
					logger.warn("The type was not found...");
1366
					map_generic.put(publisher, generic);
1367
					ReferenceBase give_generic = map_generic.get(publisher);
1368
					give_generic.setPublisher(publisher);
1369
					reference=give_generic;
1370

    
1371
					success = false;
1372
				}		 	
1373
			}
1374
			
1375
			/**
1376
			// It was not used in this Implementation
1377
			childName = "orig-pub"; // original grant number - the name in Endnote Programm
1378
			obligatory = false;
1379
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1380
			success &= doubleResult.getSecondResult();
1381
			Element elOrig_pub = doubleResult.getFirstResult();
1382
			if (elOrig_pub != null) { 
1383
			
1384
				childName = "style";
1385
				obligatory = false;
1386
				doubleResult =  XmlHelp.getSingleChildElement(elOrig_pub, childName, tcsNamespace, obligatory);
1387
				success &= doubleResult.getSecondResult();
1388
				Element elStyle_Orig_pub = doubleResult.getFirstResult();
1389
				String strColor_Orig_pub = elStyle_Orig_pub.getAttributeValue("color");
1390
				String strFace_Orig_pub = elStyle_Orig_pub.getAttributeValue("face");
1391
				String strFont_Orig_pub = elStyle_Orig_pub.getAttributeValue("font");
1392
				String strSize_Orig_pub = elStyle_Orig_pub.getAttributeValue("size");
1393
			}
1394
			*/
1395
		
1396
			logger.info("start make ISBN/ISNN ...");
1397
			childName = "isbn";
1398
			obligatory = false;
1399
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1400
			success &= doubleResult.getSecondResult();
1401
			Element elIsbn = doubleResult.getFirstResult();
1402
			
1403
			if (elIsbn != null) {
1404
			
1405
				childName = "style";
1406
				obligatory = false;
1407
				doubleResult =  XmlHelp.getSingleChildElement(elIsbn, childName, tcsNamespace, obligatory);
1408
				success &= doubleResult.getSecondResult();
1409
				Element elStyle_Isbn = doubleResult.getFirstResult();
1410
				String strColor_Isbn = elStyle_Isbn.getAttributeValue("color");
1411
				String strFace_Isbn = elStyle_Isbn.getAttributeValue("face");
1412
				String strFont_Isbn = elStyle_Isbn.getAttributeValue("font");
1413
				String strSize_Isbn = elStyle_Isbn.getAttributeValue("size");
1414
				
1415
				String strName_reftype = elRef_type.getAttributeValue("name");
1416
				String page = elStyle_Isbn.getTextNormalize();
1417
				 		
1418
				if (strName_reftype.equals("Book")) {
1419
					map_book.put(page, book);
1420
					ReferenceBase give_book = map_book.get(page);
1421
					give_book.setIsbn(page);
1422
					reference=give_book; 
1423
				}else if (strName_reftype.equals("Journal")){
1424
					map_journal.put(page, journal);
1425
					ReferenceBase give_journal = map_journal.get(page);
1426
					give_journal.setIssn(page);
1427
					reference=give_journal;
1428
				}else {
1429
					logger.warn("The type was not found...");
1430
					success = false;
1431
				}		 					 		
1432
			}
1433
			
1434
			/**
1435
			// It was not used in this Implementation
1436
			childName = "accession-num";
1437
			obligatory = false;
1438
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1439
			success &= doubleResult.getSecondResult();
1440
			Element elAccession_num = doubleResult.getFirstResult();
1441
			if (elAccession_num != null) {
1442
		
1443
				childName = "style";
1444
				obligatory = false;
1445
				doubleResult =  XmlHelp.getSingleChildElement(elAccession_num, childName, tcsNamespace, obligatory);
1446
				success &= doubleResult.getSecondResult();
1447
				Element elStyle_Accession_num = doubleResult.getFirstResult();
1448
				String strColor_Accession_num = elStyle_Accession_num.getAttributeValue("color");
1449
				String strFace_Accession_num = elStyle_Accession_num.getAttributeValue("face");
1450
				String strFont_Accession_num = elStyle_Accession_num.getAttributeValue("font");
1451
				String strSize_Accession_num = elStyle_Accession_num.getAttributeValue("size");
1452
			}
1453
			
1454
			// It was not used in this Implementation
1455
			childName = "call-num";
1456
			obligatory = false;
1457
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1458
			success &= doubleResult.getSecondResult();
1459
			Element elCall_num = doubleResult.getFirstResult();
1460
			if (elCall_num != null) {
1461
			
1462
				childName = "style";
1463
				obligatory = false;
1464
				doubleResult =  XmlHelp.getSingleChildElement(elCall_num, childName, tcsNamespace, obligatory);
1465
				success &= doubleResult.getSecondResult();
1466
				Element elStyle_Call_num = doubleResult.getFirstResult();
1467
				String strColor_Call_num = elStyle_Call_num.getAttributeValue("color");
1468
				String strFace_Call_num = elStyle_Call_num.getAttributeValue("face");
1469
				String strFont_Call_num = elStyle_Call_num.getAttributeValue("font");
1470
				String strSize_Call_num = elStyle_Call_num.getAttributeValue("size");
1471
			}
1472
			*/
1473
			
1474
			logger.info("start make electronic-resource-num ...");
1475
			childName = "electronic-resource-num";  //DOI - the name in Endnote Programm
1476
			obligatory = false;
1477
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1478
			success &= doubleResult.getSecondResult();
1479
			Element elElectronic_resource_num = doubleResult.getFirstResult();
1480
			if (elElectronic_resource_num != null) {
1481
		
1482
				childName = "style";
1483
				obligatory = false;
1484
				doubleResult =  XmlHelp.getSingleChildElement(elElectronic_resource_num, childName, tcsNamespace, obligatory);
1485
				success &= doubleResult.getSecondResult();
1486
				Element elStyle_Electronic_resource_num = doubleResult.getFirstResult();
1487
				String strColor_Electronic_resource_num = elStyle_Electronic_resource_num.getAttributeValue("color");
1488
				String strFace_Electronic_resource_num = elStyle_Electronic_resource_num.getAttributeValue("face");
1489
				String strFont_Electronic_resource_num = elStyle_Electronic_resource_num.getAttributeValue("font");
1490
				String strSize_Electronic_resource_num = elStyle_Electronic_resource_num.getAttributeValue("size");
1491
				
1492
				String dOI = elStyle_Electronic_resource_num.getTextNormalize();
1493
				reference.addExtension(dOI, ExtensionType.DOI());
1494
			}
1495
			
1496
			logger.info("start make abstract ...");
1497
			childName = "abstract";
1498
			obligatory = false;
1499
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1500
			success &= doubleResult.getSecondResult();
1501
			Element elAbstract = doubleResult.getFirstResult();
1502
			if (elAbstract != null) {
1503
			
1504
				childName = "style";
1505
				obligatory = false;
1506
				doubleResult =  XmlHelp.getSingleChildElement(elAbstract, childName, tcsNamespace, obligatory);
1507
				success &= doubleResult.getSecondResult();
1508
				Element elStyle_Abstract = doubleResult.getFirstResult();
1509
				String strColor_Abstract = elStyle_Abstract.getAttributeValue("color");
1510
				String strFace_Abstract = elStyle_Abstract.getAttributeValue("face");
1511
				String strFont_Abstract = elStyle_Abstract.getAttributeValue("font");
1512
				String strSize_Abstract = elStyle_Abstract.getAttributeValue("size");
1513
				
1514
				String annote = elStyle_Abstract.getTextNormalize();
1515
				Annotation annotation = Annotation.NewInstance(annote, Language.DEFAULT());
1516
				if (annote!= null) {	 
1517
					reference.addAnnotation(annotation);
1518
				}
1519
				else {
1520
					logger.warn("The type was not found...");
1521
					success = false;
1522
				}
1523
			}
1524
			
1525
			/**
1526
			// It was not used in this Implementation
1527
			childName = "label";
1528
			obligatory = false;
1529
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1530
			success &= doubleResult.getSecondResult();
1531
			Element elLabel = doubleResult.getFirstResult();
1532
			if (elLabel != null) {
1533
			
1534
				childName = "style";
1535
				obligatory = false;
1536
				doubleResult =  XmlHelp.getSingleChildElement(elLabel, childName, tcsNamespace, obligatory);
1537
				success &= doubleResult.getSecondResult();
1538
				Element elStyle_Label = doubleResult.getFirstResult();
1539
				String strColor_Label = elStyle_Label.getAttributeValue("color");
1540
				String strFace_Label = elStyle_Label.getAttributeValue("face");
1541
				String strFont_Label = elStyle_Label.getAttributeValue("font");
1542
				String strSize_Label = elStyle_Label.getAttributeValue("size");
1543
			}
1544
			
1545
			
1546
			// It was not used in this Implementation
1547
	     	logger.info("start make image ...");
1548
			childName = "image"; //Figure - the name in Endnote Programm
1549
			obligatory = false;
1550
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1551
			success &= doubleResult.getSecondResult();
1552
			Element elImage = doubleResult.getFirstResult();
1553
			
1554
			Media media = Media.NewInstance();
1555
			if (elImage != null){ 
1556
				String strFile = elImage.getAttributeValue("file");
1557
				String strImage_name = elImage.getAttributeValue("name");
1558
				reference.getMedia();
1559
			}
1560
			
1561
			
1562
			/**
1563
			//It was not used in this Implementation
1564
			childName = "caption";
1565
			obligatory = false;
1566
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1567
			success &= doubleResult.getSecondResult();
1568
			Element elCaption = doubleResult.getFirstResult();
1569
			if(elCaption != null) {
1570
				
1571
				childName = "style";
1572
				obligatory = false;
1573
				doubleResult =  XmlHelp.getSingleChildElement(elCaption, childName, tcsNamespace, obligatory);
1574
				success &= doubleResult.getSecondResult();
1575
				Element elStyle_Caption = doubleResult.getFirstResult();
1576
				String strColor_Caption = elStyle_Caption.getAttributeValue("color");
1577
				String strFace_Caption = elStyle_Caption.getAttributeValue("face");
1578
				String strFont_Caption = elStyle_Caption.getAttributeValue("font");
1579
				String strSize_Caption = elStyle_Caption.getAttributeValue("size");
1580
			}
1581
			
1582
			//It was not used in this Implementation
1583
			childName = "notes";
1584
			obligatory = false;
1585
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1586
			success &= doubleResult.getSecondResult();
1587
			Element elNotes = doubleResult.getFirstResult();
1588
			if (elNotes != null) {
1589
				
1590
				childName = "style";
1591
				obligatory = false;
1592
				doubleResult =  XmlHelp.getSingleChildElement(elNotes, childName, tcsNamespace, obligatory);
1593
				success &= doubleResult.getSecondResult();
1594
				Element elStyle_Notes = doubleResult.getFirstResult();
1595
				String strColor_Notes = elStyle_Notes.getAttributeValue("color");
1596
				String strFace_Notes = elStyle_Notes.getAttributeValue("face");
1597
				String strFont_Notes = elStyle_Notes.getAttributeValue("font");
1598
				String strSize_Notes = elStyle_Notes.getAttributeValue("size");
1599
				
1600
				//Annotation annotation = null;
1601
				//reference.addAnnotation(annotation);
1602
				//referenceMap.put(elStyle_Notes, reference);
1603
			}
1604
			
1605
			//It was not used in this Implementation
1606
			childName = "research-notes";
1607
			obligatory = false;
1608
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1609
			success &= doubleResult.getSecondResult();
1610
			Element elResearch_notes = doubleResult.getFirstResult();
1611
			if (elResearch_notes != null) {
1612
				
1613
				childName = "style";
1614
				obligatory = false;
1615
				doubleResult =  XmlHelp.getSingleChildElement(elResearch_notes, childName, tcsNamespace, obligatory);
1616
				success &= doubleResult.getSecondResult();
1617
				Element elStyle_Research_notes = doubleResult.getFirstResult();
1618
				String strColor_Research_notes = elStyle_Research_notes.getAttributeValue("color");
1619
				String strFace_Research_notes = elStyle_Research_notes.getAttributeValue("face");
1620
				String strFont_Research_notes = elStyle_Research_notes.getAttributeValue("font");
1621
				String strSize_Research_notes = elStyle_Research_notes.getAttributeValue("size");
1622
			}
1623
			*/
1624
			
1625
			/**It was not used in this Implementation
1626
			childName = "work-type"; // thesis type
1627
			obligatory = false;
1628
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1629
			success &= doubleResult.getSecondResult();
1630
			Element elWork_type = doubleResult.getFirstResult();
1631
			if (elWork_type!= null) {
1632
				
1633
				childName = "style";
1634
				obligatory = false;
1635
				doubleResult =  XmlHelp.getSingleChildElement(elWork_type, childName, tcsNamespace, obligatory);
1636
				success &= doubleResult.getSecondResult();
1637
				Element elStyle_Work_type = doubleResult.getFirstResult();
1638
				String strColor_Work_type = elStyle_Work_type.getAttributeValue("color");
1639
				String strFace_Work_type = elStyle_Work_type.getAttributeValue("face");
1640
				String strFont_Work_type = elStyle_Work_type.getAttributeValue("font");
1641
				String strSize_Work_type = elStyle_Work_type.getAttributeValue("size");
1642
				
1643
				String thesis_style =  elStyle_Work_type.getTextNormalize();
1644
				String strName_reftype = elRef_type.getAttributeValue("name");
1645
				
1646
				Institution institution =Institution.NewInstance();				
1647
				school.setName(thesis_style);
1648
				institution.setName(thesis_style);
1649
				
1650
				if (strName_reftype.equals("Thesis")) {
1651
					thesis.setSchool(institution);
1652
					reference= thesis;
1653
				}else if (strName_reftype.equals("Report")){
1654
					report.setInstitution(institution);
1655
					reference= report;
1656
				}else {
1657
					logger.warn("The type was not found...");
1658
					success = false;
1659
					logger.info(reference);
1660
				}		 				
1661
				logger.info(reference);
1662
			}
1663
			
1664
			/**
1665
			//It was not used in this Implementation
1666
			childName = "reviewed-item";
1667
			obligatory = false;
1668
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1669
			success &= doubleResult.getSecondResult();
1670
			Element elReviewed_item = doubleResult.getFirstResult();
1671
			if(elReviewed_item!=null) {
1672
			
1673
				childName = "style";
1674
				obligatory = false;
1675
				doubleResult =  XmlHelp.getSingleChildElement(elReviewed_item, childName, tcsNamespace, obligatory);
1676
				success &= doubleResult.getSecondResult();
1677
				Element elStyle_Reviewed_item = doubleResult.getFirstResult();
1678
				String strColor_Reviewed_item = elStyle_Reviewed_item.getAttributeValue("color");
1679
				String strFace_Reviewed_item = elStyle_Reviewed_item.getAttributeValue("face");
1680
				String strFont_Reviewed_item = elStyle_Reviewed_item.getAttributeValue("font");
1681
				String strSize_Reviewed_item = elStyle_Reviewed_item.getAttributeValue("size");
1682
			}
1683
			
1684
			//It was not used in this Implementation
1685
			childName = "remote-database-name"; //name of database - the name in endnote programm
1686
			obligatory = false;
1687
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1688
			success &= doubleResult.getSecondResult();
1689
			Element elRemote_database_name = doubleResult.getFirstResult();
1690
			if (elRemote_database_name != null) {
1691
			
1692
				childName = "style";
1693
				obligatory = false;
1694
				doubleResult =  XmlHelp.getSingleChildElement(elRemote_database_name, childName, tcsNamespace, obligatory);
1695
				success &= doubleResult.getSecondResult();
1696
				Element elStyle_Remote_database_name = doubleResult.getFirstResult();
1697
				String strColor_Remote_database_name = elStyle_Remote_database_name.getAttributeValue("color");
1698
				String strFace_Remote_database_name = elStyle_Remote_database_name.getAttributeValue("face");
1699
				String strFont_Remote_database_name = elStyle_Remote_database_name.getAttributeValue("font");
1700
				String strSize_Remote_database_name = elStyle_Remote_database_name.getAttributeValue("size");
1701
			}
1702
			
1703
			//It was not used in this Implementation
1704
			childName = "remote-database-provider"; // database provider - the name in endnote programm
1705
			obligatory = false;
1706
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1707
			success &= doubleResult.getSecondResult();
1708
			Element elRemote_database_provider = doubleResult.getFirstResult();
1709
			if (elRemote_database_provider != null) {
1710
		
1711
				childName = "style";
1712
				obligatory = false;
1713
				doubleResult =  XmlHelp.getSingleChildElement(elRemote_database_provider, childName, tcsNamespace, obligatory);
1714
				success &= doubleResult.getSecondResult();
1715
				Element elStyle_Remote_database_provider = doubleResult.getFirstResult();
1716
				String strColor_Remote_database_provider = elStyle_Remote_database_provider.getAttributeValue("color");
1717
				String strFace_Remote_database_provider = elStyle_Remote_database_provider.getAttributeValue("face");
1718
				String strFont_Remote_database_provider = elStyle_Remote_database_provider.getAttributeValue("font");
1719
				String strSize_Remote_database_provider = elStyle_Remote_database_provider.getAttributeValue("size");
1720
			}
1721
			*/
1722
			
1723
			childName = "language";
1724
			obligatory = false;
1725
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1726
			success &= doubleResult.getSecondResult();
1727
			Element elLanguage = doubleResult.getFirstResult();
1728
			if (elLanguage != null) {
1729
			
1730
				childName = "style";
1731
				obligatory = false;
1732
				doubleResult =  XmlHelp.getSingleChildElement(elLanguage, childName, tcsNamespace, obligatory);
1733
				success &= doubleResult.getSecondResult();
1734
				Element elStyle_Language = doubleResult.getFirstResult();
1735
				String strColor_Language = elStyle_Language.getAttributeValue("color");
1736
				String strFace_Language = elStyle_Language.getAttributeValue("face");
1737
				String strFont_Language = elStyle_Language.getAttributeValue("font");
1738
				String strSize_Language = elStyle_Language.getAttributeValue("size");
1739
				String label =  elStyle_Language.getTextNormalize();
1740
				
1741
				Language language =  Language.NewInstance();
1742
				language.setLabel(label);
1743
			}
1744
			
1745
			
1746
			logger.info("start make urls ...");
1747
			childName = "urls";
1748
			obligatory = false;
1749
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1750
			success &= doubleResult.getSecondResult();
1751
			Element elUrls = doubleResult.getFirstResult();
1752
			if (elUrls != null) {
1753
				childName = "web-urls";
1754
				obligatory = false;
1755
				doubleResult =  XmlHelp.getSingleChildElement(elUrls, childName, tcsNamespace, obligatory);
1756
				success &= doubleResult.getSecondResult();
1757
				Element elWeb_urls = doubleResult.getFirstResult();
1758
			
1759
				childName = "url";
1760
				obligatory = false;
1761
				doubleResult =  XmlHelp.getSingleChildElement(elWeb_urls, childName, tcsNamespace, obligatory);
1762
				success &= doubleResult.getSecondResult();
1763
				Element elUrl = doubleResult.getFirstResult();
1764
				if (elUrl != null) {
1765
					String strHas_ut = elUrl.getAttributeValue("has-ut");
1766
					String strPpv_app = elUrl.getAttributeValue("ppv-app");
1767
					String strPpv_ref = elUrl.getAttributeValue("ppv-ref");
1768
					String strPpv_ut = elUrl.getAttributeValue("ppv-ut");
1769
						
1770
					childName = "style";
1771
					obligatory = false;
1772
					doubleResult =  XmlHelp.getSingleChildElement(elUrl, childName, tcsNamespace, obligatory);
1773
					success &= doubleResult.getSecondResult();
1774
					Element elStyle_Url = doubleResult.getFirstResult();
1775
					String strColor_Url = elStyle_Url.getAttributeValue("color");
1776
					String strFace_Url = elStyle_Url.getAttributeValue("face");
1777
					String strFont_Url = elStyle_Url.getAttributeValue("font");
1778
					String strSize_Url = elStyle_Url.getAttributeValue("size");
1779
					reference.setUri(elStyle_Url.getTextNormalize());
1780
				}
1781
			
1782
				childName = "pdf-urls";
1783
				obligatory = false;
1784
				doubleResult =  XmlHelp.getSingleChildElement(elUrls, childName, tcsNamespace, obligatory);
1785
				success &= doubleResult.getSecondResult();
1786
				Element elPdf_urls = doubleResult.getFirstResult();
1787
			
1788
				childName = "url";
1789
				obligatory = false;
1790
				doubleResult =  XmlHelp.getSingleChildElement(elPdf_urls, childName, tcsNamespace, obligatory);
1791
				success &= doubleResult.getSecondResult();
1792
				Element elPdfUrl = doubleResult.getFirstResult();
1793
				if (elPdfUrl !=null) {
1794
					String strHas_ut_pdf = elPdfUrl.getAttributeValue("has-ut");
1795
					String strPpv_app_pdf = elPdfUrl.getAttributeValue("ppv-app");
1796
					String strPpv_ref_pdf = elPdfUrl.getAttributeValue("ppv-ref");
1797
					String strPpv_ut_pdf = elPdfUrl.getAttributeValue("ppv-ut");
1798
			
1799
					childName = "style";
1800
					obligatory = false;
1801
					doubleResult =  XmlHelp.getSingleChildElement(elPdfUrl, childName, tcsNamespace, obligatory);
1802
					success &= doubleResult.getSecondResult();
1803
					Element elStyle_PdfUrl = doubleResult.getFirstResult();
1804
					String strColor_PdfUrl = elStyle_PdfUrl.getAttributeValue("color");
1805
					String strFace_PdfUrl = elStyle_PdfUrl.getAttributeValue("face");
1806
					String strFont_PdfUrl = elStyle_PdfUrl.getAttributeValue("font");
1807
					String strSize_PdfUrl = elStyle_PdfUrl.getAttributeValue("size");
1808
					reference.setUri(elStyle_PdfUrl.getText());
1809
				}
1810
			
1811
				childName = "text-urls";
1812
				obligatory = false;
1813
				doubleResult =  XmlHelp.getSingleChildElement(elUrls, childName, tcsNamespace, obligatory);
1814
				success &= doubleResult.getSecondResult();
1815
				Element elText_urls = doubleResult.getFirstResult();
1816
			
1817
				childName = "url";
1818
				obligatory = false;
1819
				doubleResult =  XmlHelp.getSingleChildElement(elText_urls, childName, tcsNamespace, obligatory);
1820
				success &= doubleResult.getSecondResult();
1821
				Element elTextUrl = doubleResult.getFirstResult();
1822
				if (elTextUrl != null) {
1823
					String strHas_ut_text = elTextUrl.getAttributeValue("has-ut");
1824
					String strPpv_app_text = elTextUrl.getAttributeValue("ppv-app");
1825
					String strPpv_ref_text = elTextUrl.getAttributeValue("ppv-ref");
1826
					String strPpv_ut_text = elTextUrl.getAttributeValue("ppv-ut");
1827
			
1828
					childName = "style";
1829
					obligatory = false;
1830
					doubleResult =  XmlHelp.getSingleChildElement(elTextUrl, childName, tcsNamespace, obligatory);
1831
					success &= doubleResult.getSecondResult();
1832
					Element elStyle_TextUrl = doubleResult.getFirstResult();
1833
					String strColor_TextUrl = elStyle_TextUrl.getAttributeValue("color");
1834
					String strFace_TextUrl = elStyle_TextUrl.getAttributeValue("face");
1835
					String strFont_TextUrl = elStyle_TextUrl.getAttributeValue("font");
1836
					String strSize_TextUrl = elStyle_TextUrl.getAttributeValue("size");
1837
					reference.setUri(elStyle_TextUrl.getText());
1838
				}
1839
			
1840
				childName = "related-urls";
1841
				obligatory = false;
1842
				doubleResult =  XmlHelp.getSingleChildElement(elUrls, childName, tcsNamespace, obligatory);
1843
				success &= doubleResult.getSecondResult();
1844
				Element elRelated_urls = doubleResult.getFirstResult();
1845
			
1846
				childName = "url";
1847
				obligatory = false;
1848
				doubleResult =  XmlHelp.getSingleChildElement(elRelated_urls, childName, tcsNamespace, obligatory);
1849
				success &= doubleResult.getSecondResult();
1850
				Element elRelatedUrl = doubleResult.getFirstResult();
1851
				if (elRelatedUrl != null) {
1852
			
1853
					String strHas_ut_related = elRelatedUrl.getAttributeValue("has-ut");
1854
					String strPpv_app_related = elRelatedUrl.getAttributeValue("ppv-app");
1855
					String strPpv_ref_related = elRelatedUrl.getAttributeValue("ppv-ref");
1856
					String strPpv_ut_related = elRelatedUrl.getAttributeValue("ppv-ut");
1857
			
1858
					childName = "style";
1859
					obligatory = false;
1860
					doubleResult =  XmlHelp.getSingleChildElement(elRelatedUrl, childName, tcsNamespace, obligatory);
1861
					success &= doubleResult.getSecondResult();
1862
					Element elStyle_RelatedUrl = doubleResult.getFirstResult();
1863
					String strColor_RelatedUrl = elStyle_RelatedUrl.getAttributeValue("color");
1864
					String strFace_RelatedUrl = elStyle_RelatedUrl.getAttributeValue("face");
1865
					String strFont_RelatedUrl = elStyle_RelatedUrl.getAttributeValue("font");
1866
					String strSize_RelatedUrl = elStyle_RelatedUrl.getAttributeValue("size");	
1867
					reference.setUri(elStyle_RelatedUrl.getText());
1868
				}
1869
			
1870
				childName = "image-urls";
1871
				obligatory = false;
1872
				doubleResult =  XmlHelp.getSingleChildElement(elUrls, childName, tcsNamespace, obligatory);
1873
				success &= doubleResult.getSecondResult();
1874
				Element elImage_urls = doubleResult.getFirstResult();
1875
			
1876
				childName = "url";
1877
				obligatory = false;
1878
				doubleResult =  XmlHelp.getSingleChildElement(elImage_urls, childName, tcsNamespace, obligatory);
1879
				success &= doubleResult.getSecondResult();
1880
				Element elImageUrl = doubleResult.getFirstResult();
1881
				if (elImageUrl != null) {
1882
					
1883
					String strHas_ut_image = elImageUrl.getAttributeValue("has-ut");
1884
					String strPpv_app_image = elImageUrl.getAttributeValue("ppv-app");
1885
					String strPpv_ref_image = elImageUrl.getAttributeValue("ppv-ref");
1886
					String strPpv_ut_image = elImageUrl.getAttributeValue("ppv-ut");
1887
			
1888
					childName = "style";
1889
					obligatory = false;
1890
					doubleResult =  XmlHelp.getSingleChildElement(elImageUrl, childName, tcsNamespace, obligatory);
1891
					success &= doubleResult.getSecondResult();
1892
					Element elStyle_ImageUrl = doubleResult.getFirstResult();
1893
					String strColor_ImageUrl = elStyle_ImageUrl.getAttributeValue("color");
1894
					String strFace_ImageUrl = elStyle_ImageUrl.getAttributeValue("face");
1895
					String strFont_ImageUrl = elStyle_ImageUrl.getAttributeValue("font");
1896
					String strSize_ImageUrl = elStyle_ImageUrl.getAttributeValue("size");
1897
					reference.setUri(elStyle_ImageUrl.getText());
1898
				}
1899
			}
1900
			
1901
			/** It was not used in this Implementation
1902
			childName = "access-date";
1903
			obligatory = false;
1904
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1905
			success &= doubleResult.getSecondResult();
1906
			Element elAccess_date = doubleResult.getFirstResult();
1907
			if (elAccess_date != null) {
1908
			
1909
				childName = "style";
1910
				obligatory = false;
1911
				doubleResult =  XmlHelp.getSingleChildElement(elAccess_date, childName, tcsNamespace, obligatory);
1912
				success &= doubleResult.getSecondResult();
1913
				Element elStyle_Access_date = doubleResult.getFirstResult();
1914
				String strColor_Access_date = elStyle_Access_date.getAttributeValue("color");
1915
				String strFace_Access_date = elStyle_Access_date.getAttributeValue("face");
1916
				String strFont_Access_date = elStyle_Access_date.getAttributeValue("font");
1917
				String strSize_Access_date = elStyle_Access_date.getAttributeValue("size");
1918
			}
1919
			
1920
			
1921
			//It was not used in this Implementation
1922
			logger.info("start make modified-date ...");
1923
			childName = "modified-date"; //custom 8 - name in endnote programm
1924
			obligatory = false;
1925
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1926
			success &= doubleResult.getSecondResult();
1927
			Element elModified_date = doubleResult.getFirstResult();
1928
			if (elModified_date != null) {
1929
		
1930
				childName = "style";
1931
				obligatory = false;
1932
				doubleResult =  XmlHelp.getSingleChildElement(elModified_date, childName, tcsNamespace, obligatory);
1933
				success &= doubleResult.getSecondResult();
1934
				Element elStyle_Modified_date = doubleResult.getFirstResult();
1935
				String strColor_Modified_date = elStyle_Modified_date.getAttributeValue("color");
1936
				String strFace_Modified_date = elStyle_Modified_date.getAttributeValue("face");
1937
				String strFont_Modified_date = elStyle_Modified_date.getAttributeValue("font");
1938
				String strSize_Modified_date = elStyle_Modified_date.getAttributeValue("size");
1939
			}
1940
			
1941
			/**It was not used in this Implementation
1942
			childName = "custom1";
1943
			obligatory = false;
1944
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1945
			success &= doubleResult.getSecondResult();
1946
			Element elCustom1 = doubleResult.getFirstResult();
1947
			if (elCustom1 != null) {
1948
			
1949
				childName = "style";
1950
				obligatory = false;
1951
				doubleResult =  XmlHelp.getSingleChildElement(elCustom1, childName, tcsNamespace, obligatory);
1952
				success &= doubleResult.getSecondResult();
1953
				Element elStyle_Custom1 = doubleResult.getFirstResult();
1954
				String strColor_Custom1 = elStyle_Custom1.getAttributeValue("color");
1955
				String strFace_Custom1 = elStyle_Custom1.getAttributeValue("face");
1956
				String strFont_Custom1 = elStyle_Custom1.getAttributeValue("font");
1957
				String strSize_Custom1 = elStyle_Custom1.getAttributeValue("size");	
1958
			}
1959
			
1960
			childName = "custom2";
1961
			obligatory = false;
1962
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1963
			success &= doubleResult.getSecondResult();
1964
			Element elCustom2 = doubleResult.getFirstResult();
1965
			if (elCustom2 != null) {
1966
			
1967
				childName = "style";
1968
				obligatory = false;
1969
				doubleResult =  XmlHelp.getSingleChildElement(elCustom2, childName, tcsNamespace, obligatory);
1970
				success &= doubleResult.getSecondResult();
1971
				Element elStyle_Custom2 = doubleResult.getFirstResult();
1972
				String strColor_Custom2 = elStyle_Custom2.getAttributeValue("color");
1973
				String strFace_Custom2 = elStyle_Custom2.getAttributeValue("face");
1974
				String strFont_Custom2 = elStyle_Custom2.getAttributeValue("font");
1975
				String strSize_Custom2 = elStyle_Custom2.getAttributeValue("size");
1976
			}
1977
			
1978
			childName = "custom3";
1979
			obligatory = false;
1980
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1981
			success &= doubleResult.getSecondResult();
1982
			Element elCustom3 = doubleResult.getFirstResult();
1983
			if (elCustom3 != null) {
1984
			
1985
				childName = "style";
1986
				obligatory = false;
1987
				doubleResult =  XmlHelp.getSingleChildElement(elCustom3, childName, tcsNamespace, obligatory);
1988
				success &= doubleResult.getSecondResult();
1989
				Element elStyle_Custom3 = doubleResult.getFirstResult();
1990
				String strColor_Custom3 = elStyle_Custom3.getAttributeValue("color");
1991
				String strFace_Custom3 = elStyle_Custom3.getAttributeValue("face");
1992
				String strFont_Custom3 = elStyle_Custom3.getAttributeValue("font");
1993
				String strSize_Custom3 = elStyle_Custom3.getAttributeValue("size");
1994
			}
1995
			
1996
			childName = "custom4";
1997
			obligatory = false;
1998
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1999
			success &= doubleResult.getSecondResult();
2000
			Element elCustom4 = doubleResult.getFirstResult();
2001
			if (elCustom4 != null) {
2002
			
2003
				childName = "style";
2004
				obligatory = false;
2005
				doubleResult =  XmlHelp.getSingleChildElement(elCustom4, childName, tcsNamespace, obligatory);
2006
				success &= doubleResult.getSecondResult();
2007
				Element elStyle_Custom4 = doubleResult.getFirstResult();
2008
				String strColor_Custom4 = elStyle_Custom4.getAttributeValue("color");
2009
				String strFace_Custom4 = elStyle_Custom4.getAttributeValue("face");
2010
				String strFont_Custom4 = elStyle_Custom4.getAttributeValue("font");
2011
				String strSize_Custom4 = elStyle_Custom4.getAttributeValue("size");
2012
			}
2013
			
2014
			childName = "custom5";
2015
			obligatory = false;
2016
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
2017
			success &= doubleResult.getSecondResult();
2018
			Element elCustom5 = doubleResult.getFirstResult();
2019
			if (elCustom5 != null) {
2020
			
2021
				childName = "style";
2022
				obligatory = false;
2023
				doubleResult =  XmlHelp.getSingleChildElement(elCustom5, childName, tcsNamespace, obligatory);
2024
				success &= doubleResult.getSecondResult();
2025
				Element elStyle_Custom5 = doubleResult.getFirstResult();
2026
				String strColor_Custom5 = elStyle_Custom5.getAttributeValue("color");
2027
				String strFace_Custom5 = elStyle_Custom5.getAttributeValue("face");
2028
				String strFont_Custom5 = elStyle_Custom5.getAttributeValue("font");
2029
				String strSize_Custom5 = elStyle_Custom5.getAttributeValue("size");
2030
			}
2031
			
2032
			childName = "custom6";
2033
			obligatory = false;
2034
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
2035
			success &= doubleResult.getSecondResult();
2036
			Element elCustom6 = doubleResult.getFirstResult();
2037
			if (elCustom6 != null) {
2038
			
2039
				childName = "style";
2040
				obligatory = false;
2041
				doubleResult =  XmlHelp.getSingleChildElement(elCustom6, childName, tcsNamespace, obligatory);
2042
				success &= doubleResult.getSecondResult();
2043
				Element elStyle_Custom6 = doubleResult.getFirstResult();
2044
				String strColor_Custom6 = elStyle_Custom6.getAttributeValue("color");
2045
				String strFace_Custom6 = elStyle_Custom6.getAttributeValue("face");
2046
				String strFont_Custom6 = elStyle_Custom6.getAttributeValue("font");
2047
				String strSize_Custom6 = elStyle_Custom6.getAttributeValue("size");
2048
			}
2049
			
2050
			childName = "custom7";
2051
			obligatory = false;
2052
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
2053
			success &= doubleResult.getSecondResult();
2054
			Element elCustom7 = doubleResult.getFirstResult();
2055
			if (elCustom7 != null) {
2056
			
2057
				childName = "style";
2058
				obligatory = false;
2059
				doubleResult =  XmlHelp.getSingleChildElement(elCustom7, childName, tcsNamespace, obligatory);
2060
				success &= doubleResult.getSecondResult();
2061
				Element elStyle_Custom7 = doubleResult.getFirstResult();
2062
				String strColor_Custom7 = elStyle_Custom7.getAttributeValue("color");
2063
				String strFace_Custom7 = elStyle_Custom7.getAttributeValue("face");
2064
				String strFont_Custom7 = elStyle_Custom7.getAttributeValue("font");
2065
				String strSize_Custom7 = elStyle_Custom7.getAttributeValue("size");
2066
			}
2067
		 */		
2068
			authorMap.put(elRec_number, (Team) author);
2069
			referenceMap.put(elRec_number, reference);	 
2070
		}	
2071
		
2072
		logger.info(i + " Records handled. Saving ...");
2073
		referenceService.save(referenceMap.objects());
2074
		logger.info("end make Records ...");
2075
		return success;
2076
	}	
2077
			
2078
	/* (non-Javadoc)
2079
	 * @see eu.etaxonomy.cdm.io.common.CdmIoBase#isIgnore(eu.etaxonomy.cdm.io.common.IImportConfigurator)
2080
	 */
2081
	protected boolean isIgnore(EndnoteImportState state){
2082
		EndnoteImportConfigurator tcsConfig = state.getConfig();
2083
		return (! tcsConfig.isDoRecords());
2084
	}
2085
}
(4-4/5)