Project

General

Profile

Download (94.1 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 eu.etaxonomy.cdm.common.URI;
19
import java.net.URISyntaxException;
20
import java.util.ArrayList;
21
import java.util.HashMap;
22
import java.util.List;
23
import java.util.Map;
24

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

    
30
import eu.etaxonomy.cdm.api.service.IReferenceService;
31
import eu.etaxonomy.cdm.common.DoubleResult;
32
import eu.etaxonomy.cdm.common.XmlHelp;
33
import eu.etaxonomy.cdm.io.common.ICdmIO;
34
import eu.etaxonomy.cdm.io.common.ImportHelper;
35
import eu.etaxonomy.cdm.io.common.MapWrapper;
36
import eu.etaxonomy.cdm.model.agent.Address;
37
import eu.etaxonomy.cdm.model.agent.Contact;
38
import eu.etaxonomy.cdm.model.agent.Institution;
39
import eu.etaxonomy.cdm.model.agent.Team;
40
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
41
import eu.etaxonomy.cdm.model.common.Annotation;
42
import eu.etaxonomy.cdm.model.common.CdmBase;
43
import eu.etaxonomy.cdm.model.common.ExtensionType;
44
import eu.etaxonomy.cdm.model.common.Language;
45
import eu.etaxonomy.cdm.model.reference.IPrintedUnitBase;
46
import eu.etaxonomy.cdm.model.reference.IPublicationBase;
47
import eu.etaxonomy.cdm.model.reference.Reference;
48
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
49
/**
50
 * @author a.bukhman
51
 *
52
 */
53
@Component
54
public class EndnoteRecordsImport
55
        extends EndNoteImportBase
56
        implements ICdmIO<EndnoteImportState> {
57

    
58
    private static final long serialVersionUID = -8591314328811284619L;
59
    private static final Logger logger = Logger.getLogger(EndnoteRecordsImport.class);
60

    
61
	private static int modCount = 1000;
62

    
63
	public EndnoteRecordsImport(){
64
		super();
65
	}
66

    
67
	@Override
68
	public boolean doCheck(EndnoteImportState state){
69
		boolean result = true;
70
		return result;
71
	}
72

    
73
	@Override
74
	public void doInvoke(EndnoteImportState state){
75
		logger.info("start make XML ...");
76
		boolean success = true;
77
		String childName;
78
		boolean obligatory;
79

    
80
		MapWrapper<Team> authorMap = (MapWrapper<Team>)state.getStore(ICdmIO.TEAM_STORE);
81
		MapWrapper<Reference> referenceMap = (MapWrapper<Reference>)state.getStore(ICdmIO.REFERENCE_STORE);
82

    
83
		Map<String, Reference> map_article = new HashMap<>();
84
		Map<String, Reference> map_book = new HashMap<>();
85
		Map<String, Reference> map_book_section = new HashMap<>();
86
		Map<String, Reference> map_journal = new HashMap<>();
87
		Map<String, Reference> map_thesis = new HashMap<>();
88
		Map<String, Reference> map_patent = new HashMap<>();
89
		Map<String, Reference> map_proceedings = new HashMap<>();
90
		Map<String, Reference> map_cdDvd = new HashMap<>();
91
		Map<String, Reference> map_report = new HashMap<>();
92
		Map<String, Reference> map_database = new HashMap<>();
93
		Map<String, Reference> map_webPage = new HashMap<>();
94
		Map<String, Reference> map_generic = new HashMap<>();
95
		Map<String, Reference> map_printSeries = new HashMap<>();
96
		Map<String, Reference> map_personalCommunication = new HashMap<>();
97

    
98
		IReferenceService referenceService = getReferenceService();
99

    
100
		EndnoteImportConfigurator config = state.getConfig();
101
		Element elXml = getXmlElement(config);
102
		Namespace tcsNamespace = config.getEndnoteNamespace();
103

    
104
		logger.info("start make Records-Element ...");
105
		DoubleResult<Element, Boolean> doubleResult;
106

    
107
		childName = "records";
108
		obligatory = false;
109
		doubleResult = XmlHelp.getSingleChildElement(elXml, childName, tcsNamespace, obligatory);
110
		Element elRecords = doubleResult.getFirstResult();
111
		success &= doubleResult.getSecondResult();
112
		elRecords.getAttributes();
113

    
114
		logger.info("start make Record-Elementen ...");
115
	    String tcsElementName = "record";
116
		String idNamespace = "record";
117
		List<Element> elRecordList = elRecords.getChildren(tcsElementName, tcsNamespace);
118
		Reference reference = null;
119
		TeamOrPersonBase<?> author = null;
120
		IPrintedUnitBase printedUnitBase = null;
121

    
122

    
123
		int i = 0;
124
		// for each Record in Endnote
125
		for (Element elRecord : elRecordList){
126
			if ((++i % modCount) == 0){ logger.info("Names handled: " + (i-1));}
127
			List<String> elementList = new ArrayList<String>();
128
			//create Record element
129
			IPublicationBase publicationBase = null;
130
			CdmBase cdmBase = null;
131

    
132
			Reference article = ReferenceFactory.newArticle();
133
			Reference book = ReferenceFactory.newBook();
134
			Reference bookSection = ReferenceFactory.newBookSection();
135
			Reference thesis = ReferenceFactory.newThesis();
136
			Reference journal = ReferenceFactory.newJournal();
137
			Reference patent =  ReferenceFactory.newPatent();
138
			Reference generic = ReferenceFactory.newGeneric();
139
			Reference personalCommunication = ReferenceFactory.newPersonalCommunication();
140
			Reference proceedings  = ReferenceFactory.newProceedings();
141
			Reference printSeries = ReferenceFactory.newPrintSeries();
142
			Reference cdDvd = ReferenceFactory.newCdDvd();
143
			Reference database = ReferenceFactory.newDatabase();
144
			Reference report = ReferenceFactory.newReport();
145
			Reference webPage = ReferenceFactory.newWebPage();
146
			Institution school = Institution.NewInstance();
147
			Team authorship = Team.NewInstance();
148

    
149
			logger.info("start make database ...");
150
			childName = "database";
151
			obligatory = false;
152
			doubleResult = XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
153
			success &= doubleResult.getSecondResult();
154
			Element elDatabase = new Element ("database");
155

    
156
			if (elDatabase != null) {
157

    
158
				String strName = elDatabase.getAttributeValue("name");
159
				String strPath = elDatabase.getAttributeValue("path");
160
			}
161

    
162
			logger.info("start make source-app ...");
163
			childName = "source-app";
164
			obligatory = false;
165
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
166
			success &= doubleResult.getSecondResult();
167
			Element elSource_app = doubleResult.getFirstResult();
168
			if (elSource_app != null) {
169

    
170
				String strName_app = elSource_app.getAttributeValue("name");
171
				String strVersion = elSource_app.getAttributeValue("version");
172
			}
173

    
174
			logger.info("start make rec-number ...");
175
			childName = "rec-number";
176
			obligatory = false;
177
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
178
			success &= doubleResult.getSecondResult();
179
			Element elRec_number = doubleResult.getFirstResult();
180
			String nummer = elRec_number.getTextNormalize();
181
			int num = Integer.parseInt(nummer);
182

    
183
			if (cdmBase != null) {
184
				reference.setId(num);
185
				cdmBase.setId(num);
186
			} else {
187
				logger.warn("The type was not found...");
188
				success = false;
189
			}
190

    
191
			logger.info("start make foreign-keys ...");
192
			childName = "foreign-keys";
193
			obligatory = false;
194
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
195
			success &= doubleResult.getSecondResult();
196
			Element elForeing_keys = doubleResult.getFirstResult();
197
			if (elForeing_keys!= null) {
198
				childName = "key";
199
				obligatory = false;
200
				doubleResult =  XmlHelp.getSingleChildElement(elForeing_keys, childName, tcsNamespace, obligatory);
201
				success &= doubleResult.getSecondResult();
202
				Element elKey = doubleResult.getFirstResult();
203
				if (elKey != null) {
204
					String strApp = elKey.getAttributeValue("app");
205
					String strDb_Id = elKey.getAttributeValue("db-id");
206
				}
207
			}
208

    
209
			logger.info("start make ref-type ...");
210
			childName = "ref-type";
211
			obligatory = false;
212
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
213
			success &= doubleResult.getSecondResult();
214
			Element elRef_type = doubleResult.getFirstResult();
215

    
216
			if (elRef_type != null) {
217
				String strName_reftype = elRef_type.getAttributeValue("name");
218
				if (strName_reftype.equals("Article")) {
219
					reference =  article;
220
				}else if (strName_reftype.equals("Book")){
221
					reference =  book;
222
				}else if (strName_reftype.equals("Book Section")){
223
					reference =  bookSection;
224
				}else if (strName_reftype.equalsIgnoreCase("Patent")) {
225
					reference =  patent;
226
				}else if (strName_reftype.equalsIgnoreCase("Personal Communication")){
227
					reference = personalCommunication;
228
				}else if (strName_reftype.equalsIgnoreCase("Journal")) {
229
					reference = journal;
230
				}else if (strName_reftype.equalsIgnoreCase("CdDvd")) {
231
					reference = cdDvd;
232
				}else if (strName_reftype.equalsIgnoreCase("Database")) {
233
					reference = database;
234
				}else if (strName_reftype.equalsIgnoreCase("WebPage")) {
235
					reference = webPage;
236
				}else if (strName_reftype.equalsIgnoreCase("Report")) {
237
					reference = report;
238
				}else if (strName_reftype.equalsIgnoreCase("Thesis")) {
239
					reference = thesis;
240
				}else if (strName_reftype.equalsIgnoreCase("Print Series")){
241
					reference = printSeries;
242
				}else if (strName_reftype.equals("Journal Article")){
243
					reference = article;
244
				}else if (strName_reftype.equalsIgnoreCase("Conference Proceedings")){
245
					reference = proceedings;
246
				}else if (strName_reftype.equalsIgnoreCase("Web Page")){
247
					reference = webPage;
248
				}else {
249
					logger.warn("The type was not found...");
250
					reference = generic;
251
					success = false;
252
				}
253
			}
254

    
255
			logger.info("start make contributors ...");
256
			childName = "contributors";
257
			obligatory = false;
258
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
259
			success &= doubleResult.getSecondResult();
260
			Element elContributors = doubleResult.getFirstResult();
261
			StringBuilder authorBilder = new StringBuilder();
262
			if (elContributors != null) {
263
				childName = "authors";
264
				obligatory = false;
265
				doubleResult =  XmlHelp.getSingleChildElement(elContributors, childName, tcsNamespace, obligatory);
266
				success &= doubleResult.getSecondResult();
267
				Element elAuthors = doubleResult.getFirstResult();
268

    
269
				if (elAuthors !=null){
270
					childName = "author";
271
					obligatory = false;
272
					doubleResult =  XmlHelp.getSingleChildElement(elAuthors, childName, tcsNamespace, obligatory);
273
					success &= doubleResult.getSecondResult();
274
					Element elAuthor = doubleResult.getFirstResult();
275
					if (elAuthor!=null) {
276
						String strCorp_name = elAuthor.getAttributeValue("corp-name");
277
						String strFirst_name = elAuthor.getAttributeValue("first-name");
278
						String strInitials = elAuthor.getAttributeValue("initials");
279
						String strLast_name = elAuthor.getAttributeValue("last-name");
280
						String strMiddle_initial = elAuthor.getAttributeValue("middle-initial");
281
						String strRole = elAuthor.getAttributeValue("role");
282
						String strSalutation = elAuthor.getAttributeValue("salutation");
283
						String strSuffix = elAuthor.getAttributeValue("suffix");
284
						String strTitle = elAuthor.getAttributeValue("title");
285

    
286
						childName = "style";
287
						obligatory = false;
288
						doubleResult =  XmlHelp.getSingleChildElement(elAuthor, childName, tcsNamespace, obligatory);
289
						success &= doubleResult.getSecondResult();
290
						Element elStyle = doubleResult.getFirstResult();
291

    
292
						if (elStyle != null) {
293
							String strColor = elStyle.getAttributeValue("color");
294
							String strFace = elStyle.getAttributeValue("face");
295
							String strFont = elStyle.getAttributeValue("font");
296
							String strSize = elStyle.getAttributeValue("size");
297
							String author_style =  elStyle.getTextNormalize();
298

    
299
							reference.setAuthorship(authorship);
300
						    authorship.setNomenclaturalTitle(author_style);
301
					}
302
				}
303
			}
304
				logger.info("start make secondary-authors ...");
305
				childName = "secondary-authors";
306
				obligatory = false;
307
				doubleResult =  XmlHelp.getSingleChildElement(elContributors, childName, tcsNamespace, obligatory);
308
				success &= doubleResult.getSecondResult();
309
				Element elSecondary_Authors = doubleResult.getFirstResult();
310
				if (elSecondary_Authors != null) {
311
					childName = "author";
312
					obligatory = false;
313
					doubleResult =  XmlHelp.getSingleChildElement(elSecondary_Authors, childName, tcsNamespace, obligatory);
314
					success &= doubleResult.getSecondResult();
315
					Element elSecondary_Author = doubleResult.getFirstResult();
316
					if (elSecondary_Author != null) {
317
						String strsecondaryCorp_name = elSecondary_Author.getAttributeValue("corp-name");
318
						String strsecondaryFirst_name = elSecondary_Author.getAttributeValue("first-name");
319
						String strsecondaryInitials = elSecondary_Author.getAttributeValue("initials");
320
						String strsecondaryLast_name = elSecondary_Author.getAttributeValue("last-name");
321
						String strsecondaryMiddle_initial = elSecondary_Author.getAttributeValue("middle-initial");
322
						String strsecondaryRole = elSecondary_Author.getAttributeValue("role");
323
						String strsecondarySalutation = elSecondary_Author.getAttributeValue("salutation");
324
						String strsecondarySuffix = elSecondary_Author.getAttributeValue("suffix");
325
						String strsecondaryTitle = elSecondary_Author.getAttributeValue("title");
326

    
327
						childName = "style";
328
						obligatory = false;
329
						doubleResult =  XmlHelp.getSingleChildElement(elSecondary_Author, childName, tcsNamespace, obligatory);
330
						success &= doubleResult.getSecondResult();
331
						Element elStyle_secondary = doubleResult.getFirstResult();
332
						if (elStyle_secondary!= null) {
333
							String strColor_secondary = elStyle_secondary.getAttributeValue("color");
334
							String strFace_secondary = elStyle_secondary.getAttributeValue("face");
335
							String strFont_secondary = elStyle_secondary.getAttributeValue("font");
336
							String strSize_secondary = elStyle_secondary.getAttributeValue("size");
337
							String  secondary_author=  elStyle_secondary.getTextNormalize();
338

    
339
							reference.setAuthorship(authorship);
340
							authorship.setTitleCache(secondary_author, true);
341
						}
342
					}
343
				}
344
				/** It was not used in this Implementation
345
				logger.info("start make tertiary-authors ...");
346
				childName = "tertiary-authors";
347
				obligatory = false;
348
				doubleResult =  XmlHelp.getSingleChildElement(elContributors, childName, tcsNamespace, obligatory);
349
				success &= doubleResult.getSecondResult();
350
				Element elTertiary_Authors = doubleResult.getFirstResult();
351
				if (elTertiary_Authors != null) {
352

    
353
					childName = "author";
354
					obligatory = false;
355
					doubleResult =  XmlHelp.getSingleChildElement(elTertiary_Authors, childName, tcsNamespace, obligatory);
356
					success &= doubleResult.getSecondResult();
357
					Element elTertiary_Author = doubleResult.getFirstResult();
358
					if (elTertiary_Author != null) {
359
						String strtertiaryCorp_name = elTertiary_Author.getAttributeValue("corp-name");
360
						String strtertiaryFirst_name = elTertiary_Author.getAttributeValue("first-name");
361
						String strtertiaryInitials = elTertiary_Author.getAttributeValue("initials");
362
						String strtertiaryLast_name = elTertiary_Author.getAttributeValue("last-name");
363
						String strtertiaryMiddle_initial = elTertiary_Author.getAttributeValue("middle-initial");
364
						String strtertiaryRole = elTertiary_Author.getAttributeValue("role");
365
						String strtertiarySalutation = elTertiary_Author.getAttributeValue("salutation");
366
						String strtertiarySuffix = elTertiary_Author.getAttributeValue("suffix");
367
						String strtertiaryTitle = elTertiary_Author.getAttributeValue("title");
368

    
369
						childName = "style";
370
						obligatory = false;
371
						doubleResult =  XmlHelp.getSingleChildElement(elTertiary_Author, childName, tcsNamespace, obligatory);
372
						success &= doubleResult.getSecondResult();
373
						Element elStyle_tertiary = doubleResult.getFirstResult();
374
						if (elStyle_tertiary != null) {
375
							String strColor_tertiary = elStyle_tertiary.getAttributeValue("color");
376
							String strFace_tertiary = elStyle_tertiary.getAttributeValue("face");
377
							String strFont_tertiary = elStyle_tertiary.getAttributeValue("font");
378
							String strSize_tertiary = elStyle_tertiary.getAttributeValue("size");
379
						}
380
					}
381
				}
382
				logger.info("start make subsidiary-authors ...");
383
				childName = "subsidiary-authors";
384
				obligatory = false;
385
				doubleResult =  XmlHelp.getSingleChildElement(elContributors, childName, tcsNamespace, obligatory);
386
				success &= doubleResult.getSecondResult();
387
				Element elSubsidiary_Authors = doubleResult.getFirstResult();
388
				if (elSubsidiary_Authors != null) {
389
					childName = "author";
390
					obligatory = false;
391
					doubleResult =  XmlHelp.getSingleChildElement(elSubsidiary_Authors, childName, tcsNamespace, obligatory);
392
					success &= doubleResult.getSecondResult();
393
					Element elSubsidiary_Author = doubleResult.getFirstResult();
394
					if (elSubsidiary_Author !=null){
395
						String strSubsidiaryCorp_name = elSubsidiary_Author.getAttributeValue("corp-name");
396
						String strSubsidiaryFirst_name = elSubsidiary_Author.getAttributeValue("first-name");
397
						String strSubsidiaryInitials = elSubsidiary_Author.getAttributeValue("initials");
398
						String strSubsidiaryLast_name = elSubsidiary_Author.getAttributeValue("last-name");
399
						String strSubsidiaryMiddle_initial = elSubsidiary_Author.getAttributeValue("middle-initial");
400
						String strSubsidiaryRole = elSubsidiary_Author.getAttributeValue("role");
401
						String strSubsidiarySalutation = elSubsidiary_Author.getAttributeValue("salutation");
402
						String strSubsidiarySuffix = elSubsidiary_Author.getAttributeValue("suffix");
403
						String strSubsidiaryTitle = elSubsidiary_Author.getAttributeValue("title");
404

    
405
						childName = "style";
406
						obligatory = false;
407
						doubleResult =  XmlHelp.getSingleChildElement(elSubsidiary_Author, childName, tcsNamespace, obligatory);
408
						success &= doubleResult.getSecondResult();
409
						Element elStyle_Subsidiary = doubleResult.getFirstResult();
410
						if (elStyle_Subsidiary != null) {
411
							String strColor_Subsidiary = elStyle_Subsidiary.getAttributeValue("color");
412
							String strFace_Subsidiary = elStyle_Subsidiary.getAttributeValue("face");
413
							String strFont_Subsidiary = elStyle_Subsidiary.getAttributeValue("font");
414
							String strSize_Subsidiary = elStyle_Subsidiary.getAttributeValue("size");
415
						}
416
					}
417
				}
418
				logger.info("start make translated-authors ...");
419
				childName = "translated-authors";
420
				obligatory = false;
421
				doubleResult =  XmlHelp.getSingleChildElement(elContributors, childName, tcsNamespace, obligatory);
422
				success &= doubleResult.getSecondResult();
423
				Element elTranslated_Authors = doubleResult.getFirstResult();
424
				if (elTranslated_Authors != null) {
425
					childName = "author";
426
					obligatory = false;
427
					doubleResult =  XmlHelp.getSingleChildElement(elTranslated_Authors, childName, tcsNamespace, obligatory);
428
					success &= doubleResult.getSecondResult();
429
					Element elTranslated_Author = doubleResult.getFirstResult();
430
					if (elTranslated_Author !=null){
431
						String strTranslatedCorp_name = elTranslated_Author.getAttributeValue("corp-name");
432
						String strTranslatedFirst_name = elTranslated_Author.getAttributeValue("first-name");
433
						String strTranslatedInitials = elTranslated_Author.getAttributeValue("initials");
434
						String strTranslatedLast_name = elTranslated_Author.getAttributeValue("last-name");
435
						String strTranslatedMiddle_initial = elTranslated_Author.getAttributeValue("middle-initial");
436
						String strTranslatedRole = elTranslated_Author.getAttributeValue("role");
437
						String strTranslatedSalutation = elTranslated_Author.getAttributeValue("salutation");
438
						String strTranslatedSuffix = elTranslated_Author.getAttributeValue("suffix");
439
						String strTranslatedTitle = elTranslated_Author.getAttributeValue("title");
440

    
441
						childName = "style";
442
						obligatory = false;
443
						doubleResult =  XmlHelp.getSingleChildElement(elTranslated_Author, childName, tcsNamespace, obligatory);
444
						success &= doubleResult.getSecondResult();
445
						Element elStyle_Translated = doubleResult.getFirstResult();
446
						if (elStyle_Translated!= null) {
447
							String strColor_Translated = elStyle_Translated.getAttributeValue("color");
448
							String strFace_Translated = elStyle_Translated.getAttributeValue("face");
449
							String strFont_Translated = elStyle_Translated.getAttributeValue("font");
450
							String strSize_Translated = elStyle_Translated.getAttributeValue("size");
451
						}
452
					}
453
				}
454
				*/
455
			}
456

    
457
			logger.info("start make auth-address ...");
458
			childName = "auth-address";
459
			obligatory = false;
460
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
461
			success &= doubleResult.getSecondResult();
462
			Element elAuth_address = doubleResult.getFirstResult();
463

    
464
			if (elAuth_address != null){
465

    
466
				childName = "style";
467
				obligatory = false;
468
				doubleResult =  XmlHelp.getSingleChildElement(elAuth_address, childName, tcsNamespace, obligatory);
469
				success &= doubleResult.getSecondResult();
470
				Element elStyle_address = doubleResult.getFirstResult();
471
				String strColor_address = elStyle_address.getAttributeValue("color");
472
				String strFace_address = elStyle_address.getAttributeValue("face");
473
				String strFont_address = elStyle_address.getAttributeValue("font");
474
				String strSize_address = elStyle_address.getAttributeValue("size");
475
				String address_style = elStyle_address.getTextNormalize();
476

    
477
				Contact contact =  new Contact();
478
				Address address = Address.NewInstance();
479
				reference.setAuthorship(authorship);
480
				authorship.setContact(contact);
481
				contact.addAddress(address);
482
				address.setLocality(address_style);
483
			}
484

    
485

    
486
			logger.info("start make auth-affilation ...");
487
			childName = "auth-affiliaton";
488
			obligatory = false;
489
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
490
			success &= doubleResult.getSecondResult();
491
			Element elAuth_affilation = doubleResult.getFirstResult();
492
			if (elAuth_affilation != null) {
493

    
494
				childName = "style";
495
				obligatory = false;
496
				doubleResult =  XmlHelp.getSingleChildElement(elAuth_affilation, childName, tcsNamespace, obligatory);
497
				success &= doubleResult.getSecondResult();
498
				Element elStyle_affilation = doubleResult.getFirstResult();
499
				String strColor_affilation = elStyle_affilation.getAttributeValue("color");
500
				String strFace_affilation = elStyle_affilation.getAttributeValue("face");
501
				String strFont_affilation = elStyle_affilation.getAttributeValue("font");
502
				String strSize_affilation = elStyle_affilation.getAttributeValue("size");
503

    
504
				String affilation = elStyle_affilation.getTextNormalize();
505
				reference.addExtension(affilation, ExtensionType.AREA_OF_INTREREST());
506
			}
507

    
508
			logger.info("start make titles ...");
509
			childName = "titles";
510
			obligatory = false;
511
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
512
			success &= doubleResult.getSecondResult();
513
			Element elTitles = doubleResult.getFirstResult();
514
			if (elTitles != null) {
515

    
516
				childName = "title";
517
				obligatory = false;
518
				doubleResult =  XmlHelp.getSingleChildElement(elTitles, childName, tcsNamespace, obligatory);
519
				success &= doubleResult.getSecondResult();
520
				Element elTitle = doubleResult.getFirstResult();
521
				if (elTitle != null) {
522

    
523
					childName = "style";
524
					obligatory = false;
525
					doubleResult =  XmlHelp.getSingleChildElement(elTitle, childName, tcsNamespace, obligatory);
526
					List<Element> elList = XmlHelp.getMultipleChildElement(elTitle, childName, tcsNamespace, obligatory);
527
					StringBuilder title_new = new StringBuilder();
528
					for (int a = 0; a < elList.size(); a++){
529
						doubleResult.setFirstResult(elList.get(a));
530
						doubleResult.setSecondResult(true);
531
						success &= doubleResult.getSecondResult();
532

    
533
						Element elStyle_Title = doubleResult.getFirstResult();
534
						String title = elStyle_Title.getText();
535
						title_new.append(title+" ");
536

    
537
						if (elStyle_Title != null) {
538

    
539
							String strColor_Title = elStyle_Title.getAttributeValue("color");
540
							String strFace_Title = elStyle_Title.getAttributeValue("face");
541
							String strFont_Title = elStyle_Title.getAttributeValue("font");
542
							String strSize_Title = elStyle_Title.getAttributeValue("size");
543
							String strName_reftype = elRef_type.getAttributeValue("name");
544
							title_new.toString();
545

    
546
							if (strName_reftype.equals("Article")) {
547
								map_article.put(title_new.toString(), article);
548
								Reference give_article = map_article.get(title_new.toString());
549
								give_article.setTitle(title_new.toString());
550
								reference=give_article;
551
							}else if (strName_reftype.equals("Book")) {
552
								map_book.put(title_new.toString(), book);
553
								Reference give_book = map_book.get(title_new.toString());
554
								give_book.setTitle(title_new.toString());
555
								reference=give_book;
556
							}else if (strName_reftype.equals("Book Section")){
557
								map_book_section.put(title_new.toString(), bookSection);
558
								Reference give_book_section = map_book_section.get(title_new.toString());
559
								give_book_section.setTitle(title_new.toString());
560
								reference=give_book_section;
561
							}else if (strName_reftype.equalsIgnoreCase("Patent")) {
562
								map_patent.put(title_new.toString(), patent);
563
								Reference give_patent = map_patent.get(title_new.toString());
564
								give_patent.setTitle(title_new.toString());
565
								reference=give_patent;
566
							}else if (strName_reftype.equalsIgnoreCase("Personal Communication")){
567
								personalCommunication.setTitle(title_new.toString());
568
								reference=personalCommunication;
569
							}else if (strName_reftype.equalsIgnoreCase("Journal")) {
570
								map_journal.put(title_new.toString(), journal);
571
								Reference give_journal = map_journal.get(title_new.toString());
572
								give_journal.setTitle(title_new.toString());
573
								reference=give_journal;
574
							}else if (strName_reftype.equalsIgnoreCase("CdDvd")) {
575
								map_cdDvd.put(title_new.toString(), cdDvd);
576
								Reference give_cdDvd = map_cdDvd.get(title_new.toString());
577
								give_cdDvd.setTitle(title_new.toString());
578
								reference=give_cdDvd;
579
							}else if (strName_reftype.equalsIgnoreCase("Database")) {
580
								map_database.put(title_new.toString(), database);
581
								Reference give_database = map_database.get(title_new.toString());
582
								give_database.setTitle(title_new.toString());
583
								reference=give_database;
584
							}else if (strName_reftype.equalsIgnoreCase("WebPage")) {
585
								map_webPage.put(title_new.toString(), webPage);
586
								Reference give_webPage = map_webPage.get(title_new.toString());
587
								give_webPage.setTitle(title_new.toString());
588
								reference=give_webPage;
589
							}else if (strName_reftype.equalsIgnoreCase("Report")) {
590
								map_report.put(title_new.toString(), report);
591
								Reference give_report = map_report.get(title_new.toString());
592
								give_report.setTitle(title_new.toString());
593
								reference=give_report;
594
							}else if (strName_reftype.equalsIgnoreCase("Thesis")) {
595
								map_thesis.put(title_new.toString(), thesis);
596
								Reference give_thesis = map_thesis.get(title_new.toString());
597
								give_thesis.setTitle(title_new.toString());
598
								reference=give_thesis;
599
							}else if (strName_reftype.equalsIgnoreCase("Print Series")){
600
								map_printSeries.put(title_new.toString(), printSeries);
601
								Reference give_printSeries = map_printSeries.get(title_new.toString());
602
								give_printSeries.setTitle(title_new.toString());
603
							}else if (strName_reftype.equals("Journal Article")){
604
								map_article.put(title_new.toString(), article);
605
								Reference give_article = map_article.get(title_new.toString());
606
								give_article.setTitle(title_new.toString());
607
								reference=give_article;
608
							}else if (strName_reftype.equalsIgnoreCase("Conference Proceedings")){
609
								map_proceedings.put(title_new.toString(), proceedings);
610
								Reference give_proceedings = map_proceedings.get(title_new.toString());
611
								give_proceedings.setTitle(title_new.toString());
612
								reference=give_proceedings;
613
							}else {
614
								logger.warn("The type was not found...");
615
								map_generic.put(title_new.toString(), generic);
616
								Reference give_generic = map_generic.get(title_new.toString());
617
								give_generic.setTitle(title_new.toString());
618
								reference=give_generic;
619
								success = false;
620
							}
621
						}
622
					}
623
				}
624

    
625
				childName = "secondary-title";
626
				obligatory = false;
627
				doubleResult =  XmlHelp.getSingleChildElement(elTitles, childName, tcsNamespace, obligatory);
628
				success &= doubleResult.getSecondResult();
629
				Element elSecondary_title = doubleResult.getFirstResult();
630
				if (elSecondary_title!=null) {
631
					childName = "style";
632
					obligatory = false;
633
					doubleResult =  XmlHelp.getSingleChildElement(elSecondary_title, childName, tcsNamespace, obligatory);
634
					success &= doubleResult.getSecondResult();
635
					Element elStyle_Secondary_title = doubleResult.getFirstResult();
636
					if (elStyle_Secondary_title != null) {
637
						String strColor_Secondary_title = elStyle_Secondary_title.getAttributeValue("color");
638
						String strFace_Secondary_title = elStyle_Secondary_title.getAttributeValue("face");
639
						String strFont_Secondary_title = elStyle_Secondary_title.getAttributeValue("font");
640
						String strSize_Secondary_title = elStyle_Secondary_title.getAttributeValue("size");
641
						String strName_reftype = elRef_type.getAttributeValue("name");
642
						String secondary_title = elStyle_Secondary_title.getTextNormalize();
643

    
644
						if (strName_reftype.equals("Book Section")){
645
				    		if (secondary_title != null) {
646
				    			Reference give_book =map_book.get(secondary_title);
647
				    			if (give_book!= null) {
648
				    				bookSection.setInBook(give_book);
649
				    				give_book.setTitle(secondary_title);
650
				    			} else {
651
				    				bookSection.setInBook(book);
652
				    				map_book.put(secondary_title, book);
653
				    				book.setTitle(secondary_title);
654
				    			}
655
				    			reference=bookSection;
656
				    		}
657
				    	}else {
658
							logger.warn("The type was not found...");
659
							map_generic.put(secondary_title, generic);
660
							Reference give_generic = map_generic.get(secondary_title);
661
							give_generic.setTitle(secondary_title);
662
							reference=give_generic;
663
							success = false;
664
						}
665
					}
666
				}
667

    
668
				/** It was not used in this Implementation
669
				childName = "tertiary-title";
670
				obligatory = false;
671
				doubleResult =  XmlHelp.getSingleChildElement(elTitles, childName, tcsNamespace, obligatory);
672
				success &= doubleResult.getSecondResult();
673
				Element elTertiary_title = doubleResult.getFirstResult();
674
				if (elTertiary_title != null){
675
					childName = "style";
676
					obligatory = false;
677
					doubleResult =  XmlHelp.getSingleChildElement(elTertiary_title, childName, tcsNamespace, obligatory);
678
					success &= doubleResult.getSecondResult();
679
					Element elStyle_Tertiary_title = doubleResult.getFirstResult();
680
					if (elStyle_Tertiary_title != null) {
681
						String strColor_Tertiary_title = elStyle_Tertiary_title.getAttributeValue("color");
682
						String strFace_Tertiary_title = elStyle_Tertiary_title.getAttributeValue("face");
683
						String strFont_Tertiary_title = elStyle_Tertiary_title.getAttributeValue("font");
684
						String strSize_Tertiary_title = elStyle_Tertiary_title.getAttributeValue("size");
685
					}
686
				}
687
				childName = "alt-title";
688
				obligatory = false;
689
				doubleResult =  XmlHelp.getSingleChildElement(elTitles, childName, tcsNamespace, obligatory);
690
				success &= doubleResult.getSecondResult();
691
				Element elAlt_title = doubleResult.getFirstResult();
692
				if (elAlt_title != null) {
693
					childName = "style";
694
					obligatory = false;
695
					doubleResult =  XmlHelp.getSingleChildElement(elAlt_title, childName, tcsNamespace, obligatory);
696
					success &= doubleResult.getSecondResult();
697
					Element elStyle_Alt_title = doubleResult.getFirstResult();
698
					if (elStyle_Alt_title != null) {
699
						String strColor_Alt_title = elStyle_Alt_title.getAttributeValue("color");
700
						String strFace_Alt_title = elStyle_Alt_title.getAttributeValue("face");
701
						String strFont_Alt_title = elStyle_Alt_title.getAttributeValue("font");
702
						String strSize_Alt_title = elStyle_Alt_title.getAttributeValue("size");
703
					}
704
				}
705
				childName = "short-title";
706
				obligatory = false;
707
				doubleResult =  XmlHelp.getSingleChildElement(elTitles, childName, tcsNamespace, obligatory);
708
				success &= doubleResult.getSecondResult();
709
				Element elShort_title = doubleResult.getFirstResult();
710
				if (elShort_title != null) {
711

    
712
					childName = "style";
713
					obligatory = false;
714
					doubleResult =  XmlHelp.getSingleChildElement(elShort_title, childName, tcsNamespace, obligatory);
715
					success &= doubleResult.getSecondResult();
716
					Element elStyle_Short_title = doubleResult.getFirstResult();
717
					if (elStyle_Short_title != null) {
718
						String strColor_Short_title = elStyle_Short_title.getAttributeValue("color");
719
						String strFace_Short_title = elStyle_Short_title.getAttributeValue("face");
720
						String strFont_Short_title = elStyle_Short_title.getAttributeValue("font");
721
						String strSize_Short_title = elStyle_Short_title.getAttributeValue("size");
722
					}
723
				}
724

    
725
				childName = "translated-title";
726
				obligatory = false;
727
				doubleResult =  XmlHelp.getSingleChildElement(elTitles, childName, tcsNamespace, obligatory);
728
				success &= doubleResult.getSecondResult();
729
				Element elTranslated_title = doubleResult.getFirstResult();
730
				if (elTranslated_title != null) {
731

    
732
					childName = "style";
733
					obligatory = false;
734
					doubleResult =  XmlHelp.getSingleChildElement(elTranslated_title, childName, tcsNamespace, obligatory);
735
					success &= doubleResult.getSecondResult();
736
					Element elStyle_Translated_title = doubleResult.getFirstResult();
737
					if (elStyle_Translated_title != null) {
738
						String strColor_Translated_title = elStyle_Translated_title.getAttributeValue("color");
739
						String strFace_Translated_title = elStyle_Translated_title.getAttributeValue("face");
740
						String strFont_Translated_title = elStyle_Translated_title.getAttributeValue("font");
741
						String strSize_Translated_title = elStyle_Translated_title.getAttributeValue("size");
742
					}
743
				}
744
			*/
745
			}
746

    
747
			logger.info("start make periodical ...");
748
			childName = "periodical";
749
			obligatory = false;
750
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
751
			success &= doubleResult.getSecondResult();
752
			Element elPeriodical = doubleResult.getFirstResult();
753
			if (elPeriodical != null) {
754

    
755
				childName = "full-title";
756
				obligatory = false;
757
				doubleResult =  XmlHelp.getSingleChildElement(elPeriodical, childName, tcsNamespace, obligatory);
758
				success &= doubleResult.getSecondResult();
759
				Element elFull_title = doubleResult.getFirstResult();
760
			    if (elFull_title != null) {
761

    
762
			    	childName = "style";
763
			    	obligatory = false;
764
			    	doubleResult =  XmlHelp.getSingleChildElement(elFull_title, childName, tcsNamespace, obligatory);
765
			    	success &= doubleResult.getSecondResult();
766
			    	Element elStyle_Full_title = doubleResult.getFirstResult();
767
			    	String strColor_Full_title = elStyle_Full_title.getAttributeValue("color");
768
			    	String strFace_Full_title = elStyle_Full_title.getAttributeValue("face");
769
			    	String strFont_Full_title = elStyle_Full_title.getAttributeValue("font");
770
			    	String strSize_Full_title = elStyle_Full_title.getAttributeValue("size");
771

    
772
			    	String strName_reftype = elRef_type.getAttributeValue("name");
773
			    	String periodical = elStyle_Full_title.getTextNormalize();
774

    
775
			    	if (strName_reftype.equals("Journal Article")){
776

    
777
			    		if (periodical != null) {
778
			    			Reference give_journal = map_journal.get(periodical);
779
							if (give_journal!= null) {
780
								article.setInJournal(give_journal);
781
								give_journal.setTitle(periodical);
782
							} else {
783
								article.setInJournal(journal);
784
								map_journal.put(periodical, journal);
785
								journal.setTitle(periodical);
786
							}
787
							reference=article;
788
			    		}
789
			    	} else {
790
						logger.warn("The type was not found...");
791
						success = false;
792
					}
793
			    }
794

    
795
			    /** It was not used in this Implementation
796
			    childName = "abbr-1";
797
			    obligatory = false;
798
			    doubleResult =  XmlHelp.getSingleChildElement(elPeriodical, childName, tcsNamespace, obligatory);
799
			    success &= doubleResult.getSecondResult();
800
			    Element elAbbr_1 = doubleResult.getFirstResult();
801
			    if (elAbbr_1 != null) {
802

    
803
			    	childName = "style";
804
			    	obligatory = false;
805
			    	doubleResult =  XmlHelp.getSingleChildElement(elAbbr_1, childName, tcsNamespace, obligatory);
806
			    	success &= doubleResult.getSecondResult();
807
			    	Element elStyle_Abbr_1 = doubleResult.getFirstResult();
808
			    	String strColor_Abbr_1 = elStyle_Abbr_1.getAttributeValue("color");
809
			    	String strFace_Abbr_1 = elStyle_Abbr_1.getAttributeValue("face");
810
			    	String strFont_Abbr_1 = elStyle_Abbr_1.getAttributeValue("font");
811
			    	String strSize_Abbr_1 = elStyle_Abbr_1.getAttributeValue("size");
812
			    }
813

    
814
			    childName = "abbr-2";
815
			    obligatory = false;
816
			    doubleResult =  XmlHelp.getSingleChildElement(elPeriodical, childName, tcsNamespace, obligatory);
817
			    success &= doubleResult.getSecondResult();
818
			    Element elAbbr_2 = doubleResult.getFirstResult();
819
			    if (elAbbr_2 != null) {
820

    
821
			    	childName = "style";
822
			    	obligatory = false;
823
			    	doubleResult =  XmlHelp.getSingleChildElement(elAbbr_2, childName, tcsNamespace, obligatory);
824
			    	success &= doubleResult.getSecondResult();
825
			    	Element elStyle_Abbr_2 = doubleResult.getFirstResult();
826
			    	String strColor_Abbr_2 = elStyle_Abbr_2.getAttributeValue("color");
827
			    	String strFace_Abbr_2 = elStyle_Abbr_2.getAttributeValue("face");
828
			    	String strFont_Abbr_2 = elStyle_Abbr_2.getAttributeValue("font");
829
			    	String strSize_Abbr_2 = elStyle_Abbr_2.getAttributeValue("size");
830
			    }
831

    
832
			    childName = "abbr_3";
833
			    obligatory = false;
834
			    doubleResult =  XmlHelp.getSingleChildElement(elPeriodical, childName, tcsNamespace, obligatory);
835
			    success &= doubleResult.getSecondResult();
836
			    Element elAbbr_3 = doubleResult.getFirstResult();
837
			    if (elAbbr_3 != null) {
838

    
839
			    	childName = "style";
840
			    	obligatory = false;
841
			    	doubleResult =  XmlHelp.getSingleChildElement(elAbbr_3, childName, tcsNamespace, obligatory);
842
			    	success &= doubleResult.getSecondResult();
843
			    	Element elStyle_Abbr_3 = doubleResult.getFirstResult();
844
			    	String strColor_Abbr_3 = elStyle_Abbr_3.getAttributeValue("color");
845
			    	String strFace_Abbr_3 = elStyle_Abbr_3.getAttributeValue("face");
846
			    	String strFont_Abbr_3 = elStyle_Abbr_3.getAttributeValue("font");
847
			    	String strSize_Abbr_3 = elStyle_Abbr_3.getAttributeValue("size");
848
			    }
849
			*/
850
			}
851

    
852
			logger.info("start make pages ...");
853
			childName = "pages";
854
			obligatory = false;
855
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
856
			success &= doubleResult.getSecondResult();
857
			Element elPages = doubleResult.getFirstResult();
858
			if (elPages != null) {
859
				String strEnd = elPages.getAttributeValue("end");
860
				String strStart = elPages.getAttributeValue("start");
861

    
862
				childName = "style";
863
				obligatory = false;
864
				doubleResult =  XmlHelp.getSingleChildElement(elPages, childName, tcsNamespace, obligatory);
865
				success &= doubleResult.getSecondResult();
866
				Element elStyle_Pages = doubleResult.getFirstResult();
867
				String strColor_Pages = elStyle_Pages.getAttributeValue("color");
868
				String strFace_Pages = elStyle_Pages.getAttributeValue("face");
869
				String strFont_Pages = elStyle_Pages.getAttributeValue("font");
870
				String strSize_Pages = elStyle_Pages.getAttributeValue("size");
871

    
872
				String strName_reftype = elRef_type.getAttributeValue("name");
873
				String page = elStyle_Pages.getTextNormalize();
874

    
875
				if (strName_reftype.equals("Journal Article")) {
876
					map_article.put(page, article);
877
					Reference give_article = map_article.get(page);
878
					give_article.setPages(page);
879
					reference = give_article;
880
				}else if (strName_reftype.equals("Article")){
881
					map_article.put(page, article);
882
					Reference give_article = map_article.get(page);
883
					give_article.setPages(page);
884
					reference = give_article;
885
				}else if (strName_reftype.equals("Book")){
886
					map_book.put(page, book);
887
					Reference give_book = map_book.get(page);
888
					give_book.setPages(page);
889
					reference=give_book;
890
				}else if (strName_reftype.equals("Book Section")){
891
					map_book_section.put(page, bookSection);
892
					Reference give_book_section = map_book_section.get(page);
893
					give_book_section.setPages(page);
894
					reference=give_book_section;
895
				}else if (strName_reftype.equalsIgnoreCase("Conference Proceedings")){
896
					map_proceedings.put(page, proceedings);
897
					Reference give_proceedings = map_proceedings.get(page);
898
					give_proceedings.setPages(page);
899
					reference=give_proceedings;
900
				} else {
901
					logger.warn("The type was not found...");
902
					map_generic.put(page, generic);
903
					Reference give_generic  = map_generic.get(page);
904
					give_generic.setPages(page);
905
					reference =give_generic;
906
					success = false;
907
				}
908
			}
909

    
910
			logger.info("start make volume ...");
911
			childName = "volume";
912
			obligatory = false;
913
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
914
			success &= doubleResult.getSecondResult();
915
			Element elVolume = doubleResult.getFirstResult();
916
			if (elVolume != null) {
917
				childName = "style";
918
				obligatory = false;
919
				doubleResult =  XmlHelp.getSingleChildElement(elVolume, childName, tcsNamespace, obligatory);
920
				success &= doubleResult.getSecondResult();
921
				Element elStyle_Volume = doubleResult.getFirstResult();
922
				String strColor_Volume = elStyle_Volume.getAttributeValue("color");
923
				String strFace_Volume = elStyle_Volume.getAttributeValue("face");
924
				String strFont_Volume = elStyle_Volume.getAttributeValue("font");
925
				String strSize_Volume = elStyle_Volume.getAttributeValue("size");
926

    
927
				String strName_reftype = elRef_type.getAttributeValue("name");
928
				String volume = elStyle_Volume.getTextNormalize();
929

    
930
				if (strName_reftype.equals("Journal Article")) {
931
					map_article.put(volume, article);
932
					Reference give_article = map_article.get(volume);
933
					give_article.setVolume(volume);
934
					reference = give_article;
935
				}else if (strName_reftype.equals("Article")){
936
					map_article.put(volume, article);
937
					Reference give_article = map_article.get(volume);
938
					give_article.setVolume(volume);
939
					reference = give_article;
940
				}else if (strName_reftype.equals("Book")){
941
					map_book.put(volume, book);
942
					Reference give_book = map_book.get(volume);
943
					give_book.setVolume(volume);
944
					reference=give_book;
945
				}else if (strName_reftype.equals("Book Section")){
946
					 if (volume != null) {
947
						 bookSection.setInBook(book);
948
						 book.setVolume(volume);
949
						 reference= bookSection;
950
					 }
951
				}else if (strName_reftype.equalsIgnoreCase("Conference Proceedings")){
952
					map_proceedings.put(volume, proceedings);
953
					Reference give_proceedings = map_proceedings.get(volume);
954
					give_proceedings.setVolume(volume);
955
					reference=give_proceedings;
956
				}else{
957
					logger.warn("The type was not found...");
958
					map_generic.put(volume, generic);
959
					Reference give_generic  = map_generic.get(volume);
960
					give_generic.setVolume(volume);
961
					reference =give_generic;
962
					success = true;
963
				}
964
			}
965

    
966
			logger.info("start make number ...");
967
			childName = "number"; // In CDM it's "Series"
968
			obligatory = false;
969
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
970
			success &= doubleResult.getSecondResult();
971
			Element elNumber = doubleResult.getFirstResult();
972
			if (elNumber != null) {
973

    
974
				childName = "style";
975
				obligatory = false;
976
				doubleResult =  XmlHelp.getSingleChildElement(elNumber, childName, tcsNamespace, obligatory);
977
				success &= doubleResult.getSecondResult();
978
				Element elStyle_Number = doubleResult.getFirstResult();
979
				String strColor_Number = elStyle_Number.getAttributeValue("color");
980
				String strFace_Number = elStyle_Number.getAttributeValue("face");
981
				String strFont_Number = elStyle_Number.getAttributeValue("font");
982
				String strSize_Number = elStyle_Number.getAttributeValue("size");
983

    
984
				String strName_reftype = elRef_type.getAttributeValue("name");
985
				String number = elStyle_Number.getTextNormalize();
986

    
987
				if (strName_reftype.equals("Journal Article")) {
988
					map_article.put(number, article);
989
					Reference give_article = map_article.get(number);
990
					give_article.setSeriesPart(number);
991
					reference = give_article;
992
				}else if (strName_reftype.equals("Article")){
993
					map_article.put(number, article);
994
					Reference give_article = map_article.get(number);
995
					give_article.setSeriesPart(number);
996
					reference = give_article;
997
				}else {
998
					logger.warn("The type was not found...");
999
					map_generic.put(number, generic);
1000
					Reference give_generic  = map_generic.get(number);
1001
					give_generic.setSeriesPart(number);
1002
					reference =give_generic;
1003
					success = false;
1004
				}
1005
			}
1006

    
1007
			/**
1008
			// NOT USE IN THE IMPLEMENTATION
1009
			childName = "issue"; // not use in CDM
1010
			obligatory = false;
1011
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1012
			success &= doubleResult.getSecondResult();
1013
			Element elIssue = doubleResult.getFirstResult();
1014
			if (elIssue != null) {
1015

    
1016
				childName = "style";
1017
				obligatory = false;
1018
				doubleResult =  XmlHelp.getSingleChildElement(elIssue, childName, tcsNamespace, obligatory);
1019
				success &= doubleResult.getSecondResult();
1020
				Element elStyle_Issue = doubleResult.getFirstResult();
1021
				String strColor_Issue = elStyle_Issue.getAttributeValue("color");
1022
				String strFace_Issue = elStyle_Issue.getAttributeValue("face");
1023
				String strFont_Issue = elStyle_Issue.getAttributeValue("font");
1024
				String strSize_Issue = elStyle_Issue.getAttributeValue("size");
1025
			}
1026

    
1027
			// LIKE NUMBER ELEMENT (the same content) use very selten
1028
			//Amount Received - the name in Endnote Programm
1029
			childName = "num-vols"; // not use in CDM
1030
			obligatory = false;
1031
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1032
			success &= doubleResult.getSecondResult();
1033
			Element elNum_vols = doubleResult.getFirstResult();
1034
			if (elNum_vols != null) {
1035
				childName = "style";
1036
				obligatory = false;
1037
				doubleResult =  XmlHelp.getSingleChildElement(elNum_vols, childName, tcsNamespace, obligatory);
1038
				success &= doubleResult.getSecondResult();
1039
				Element elStyle_Num_vols = doubleResult.getFirstResult();
1040
				String strColor_Num_vols = elStyle_Num_vols.getAttributeValue("color");
1041
				String strFace_Num_vols = elStyle_Num_vols.getAttributeValue("face");
1042
				String strFont_Num_vols = elStyle_Num_vols.getAttributeValue("font");
1043
				String strSize_Num_vols = elStyle_Num_vols.getAttributeValue("size");
1044
			}
1045
			*/
1046

    
1047
			logger.info("start make edition ...");
1048
			childName = "edition";
1049
			obligatory = false;
1050
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1051
			success &= doubleResult.getSecondResult();
1052
			Element elEdition = doubleResult.getFirstResult();
1053
			if (elEdition != null) {
1054
				childName = "style";
1055
				obligatory = false;
1056
				doubleResult =  XmlHelp.getSingleChildElement(elEdition, childName, tcsNamespace, obligatory);
1057
				success &= doubleResult.getSecondResult();
1058
				Element elStyle_Edition = doubleResult.getFirstResult();
1059
				String strColor_Edition = elStyle_Edition.getAttributeValue("color");
1060
				String strFace_Edition = elStyle_Edition.getAttributeValue("face");
1061
				String strFont_Edition = elStyle_Edition.getAttributeValue("font");
1062
				String strSize_Edition = elStyle_Edition.getAttributeValue("size");
1063

    
1064
				String strName_reftype = elRef_type.getAttributeValue("name");
1065
				String edition = elStyle_Edition.getTextNormalize();
1066

    
1067
				if (strName_reftype.equals("Book")) {
1068
					map_book.put(edition, book);
1069
					Reference give_book = map_book.get(edition);
1070
					give_book.setEdition(edition);
1071
					reference=give_book;
1072
				}else if (strName_reftype.equals("Book Section")) {
1073
					bookSection.setInBook(book);
1074
					book.setEdition(edition);
1075
					reference=bookSection;
1076
				}else {
1077
					logger.warn("The type was not found...");
1078
					success = false;
1079
				}
1080
			}
1081

    
1082
			/**It was not used in this Implementation
1083
			// LIKE NUMBER ELEMENT (the same content) use very selten
1084
			childName = "section";
1085
			obligatory = false;
1086
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1087
			success &= doubleResult.getSecondResult();
1088
			Element elSection = doubleResult.getFirstResult();
1089
			if (elSection != null) {
1090
				childName = "style";
1091
				obligatory = false;
1092
				doubleResult =  XmlHelp.getSingleChildElement(elSection, childName, tcsNamespace, obligatory);
1093
				success &= doubleResult.getSecondResult();
1094
				Element elStyle_Section = doubleResult.getFirstResult();
1095
				String strColor_Section = elStyle_Section.getAttributeValue("color");
1096
				String strFace_Section = elStyle_Section.getAttributeValue("face");
1097
				String strFont_Section = elStyle_Section.getAttributeValue("font");
1098
				String strSize_Section = elStyle_Section.getAttributeValue("size");
1099
			}
1100

    
1101
			// NOT USE IN THE IMPLEMENTATION
1102
			childName = "reprint-edition";
1103
			obligatory = false;
1104
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1105
			success &= doubleResult.getSecondResult();
1106
			Element elReprint_edition = doubleResult.getFirstResult();
1107
			if (elReprint_edition != null) {
1108

    
1109
				childName = "style";
1110
				obligatory = false;
1111
				doubleResult =  XmlHelp.getSingleChildElement(elReprint_edition, childName, tcsNamespace, obligatory);
1112
				success &= doubleResult.getSecondResult();
1113
				Element elStyle_Reprint_edition = doubleResult.getFirstResult();
1114
				String strColor_Reprint_edition = elStyle_Reprint_edition.getAttributeValue("color");
1115
				String strFace_Reprint_edition = elStyle_Reprint_edition.getAttributeValue("face");
1116
				String strFont_Reprint_edition = elStyle_Reprint_edition.getAttributeValue("font");
1117
				String strSize_Reprint_edition = elStyle_Reprint_edition.getAttributeValue("size");
1118
			}
1119

    
1120
			// use very selten keywords use multiple keyword elements
1121
			childName = "keywords";
1122
			obligatory = false;
1123
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1124
			success &= doubleResult.getSecondResult();
1125
			Element elKeywords = doubleResult.getFirstResult();
1126
			if (elKeywords != null) {
1127

    
1128
				childName = "keyword";
1129
				obligatory = false;
1130
				doubleResult =  XmlHelp.getSingleChildElement(elKeywords, childName, tcsNamespace, obligatory);
1131
				success &= doubleResult.getSecondResult();
1132
				Element elKeyword = doubleResult.getFirstResult();
1133
				if (elKeyword != null) {
1134
					childName = "style";
1135
					obligatory = false;
1136
					doubleResult =  XmlHelp.getSingleChildElement(elKeyword, childName, tcsNamespace, obligatory);
1137
					success &= doubleResult.getSecondResult();
1138
					Element elStyle_Keyword = doubleResult.getFirstResult();
1139
					String strColor_Keyword = elStyle_Keyword.getAttributeValue("color");
1140
					String strFace_Keyword = elStyle_Keyword.getAttributeValue("face");
1141
					String strFont_Keyword = elStyle_Keyword.getAttributeValue("font");
1142
					String strSize_Keyword = elStyle_Keyword.getAttributeValue("size");
1143
				}
1144
			}
1145
			*/
1146

    
1147
			childName = "dates";
1148
			obligatory = false;
1149
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1150
			success &= doubleResult.getSecondResult();
1151
			Element elDates = doubleResult.getFirstResult();
1152
			if (elDates != null) {
1153

    
1154
				childName = "year";
1155
				obligatory = false;
1156
				doubleResult =  XmlHelp.getSingleChildElement(elDates, childName, tcsNamespace, obligatory);
1157
				success &= doubleResult.getSecondResult();
1158
				Element elYear = doubleResult.getFirstResult();
1159
				if (elYear != null) {
1160
					String strDay = elYear.getAttributeValue("day");
1161
					String strJulian = elYear.getAttributeValue("julian");
1162
					String strMonth = elYear.getAttributeValue("month");
1163
					String strYear = elYear.getAttributeValue("year");
1164

    
1165
					childName = "style";
1166
					obligatory = false;
1167
					doubleResult =  XmlHelp.getSingleChildElement(elYear, childName, tcsNamespace, obligatory);
1168
					success &= doubleResult.getSecondResult();
1169
					Element elStyle_Year = doubleResult.getFirstResult();
1170
					String strColor_Year = elStyle_Year.getAttributeValue("color");
1171
					String strFace_Year = elStyle_Year.getAttributeValue("face");
1172
					String strFont_Year = elStyle_Year.getAttributeValue("font");
1173
					String strSize_Year = elStyle_Year.getAttributeValue("size");
1174

    
1175
					String year = elStyle_Year.getText();
1176
					reference.setDatePublished(ImportHelper.getDatePublished(year));
1177

    
1178
				}
1179

    
1180
				logger.info("start make pub-dates ...");
1181
				childName = "pub-dates";  //deadline - the name in Endnote Programm
1182
				obligatory = false;
1183
				doubleResult =  XmlHelp.getSingleChildElement(elDates, childName, tcsNamespace, obligatory);
1184
				success &= doubleResult.getSecondResult();
1185
				Element elPub_dates = doubleResult.getFirstResult();
1186
				if (elPub_dates != null) {
1187

    
1188
					childName = "date";
1189
					obligatory = false;
1190
					doubleResult =  XmlHelp.getSingleChildElement(elPub_dates, childName, tcsNamespace, obligatory);
1191
					success &= doubleResult.getSecondResult();
1192
					Element elDate = doubleResult.getFirstResult();
1193
					if (elDate != null){
1194

    
1195
					childName = "style";
1196
					obligatory = false;
1197
					doubleResult =  XmlHelp.getSingleChildElement(elDate, childName, tcsNamespace, obligatory);
1198
					success &= doubleResult.getSecondResult();
1199
					Element elStyle_Date = doubleResult.getFirstResult();
1200
					String strColor_Date = elStyle_Date.getAttributeValue("color");
1201
					String strFace_Date = elStyle_Date.getAttributeValue("face");
1202
					String strFont_Date = elStyle_Date.getAttributeValue("font");
1203
					String strSize_Date = elStyle_Date.getAttributeValue("size");
1204

    
1205
					String year = elStyle_Date.getText();
1206
					reference.setDatePublished(ImportHelper.getDatePublished(year));
1207
					}
1208
				}
1209
			}
1210

    
1211
			logger.info("start make pub-location ...");
1212
		 	childName = "pub-location"; // activity location - the name in Endnote Programm
1213
		 	obligatory = false;
1214
		 	doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1215
		 	success &= doubleResult.getSecondResult();
1216
		 	Element elPub_location = doubleResult.getFirstResult();
1217
		 	if (elPub_location != null) {
1218

    
1219
		 		childName = "style";
1220
		 		obligatory = false;
1221
		 		doubleResult =  XmlHelp.getSingleChildElement(elPub_location, childName, tcsNamespace, obligatory);
1222
		 		success &= doubleResult.getSecondResult();
1223
		 		Element elStyle_Pub_location = doubleResult.getFirstResult();
1224
		 		String strColor_Pub_location = elStyle_Pub_location.getAttributeValue("color");
1225
		 		String strFace_Pub_location = elStyle_Pub_location.getAttributeValue("face");
1226
		 		String strFont_Pub_location = elStyle_Pub_location.getAttributeValue("font");
1227
		 		String strSize_Pub_location = elStyle_Pub_location.getAttributeValue("size");
1228

    
1229
		 		String place = elStyle_Pub_location.getTextNormalize();
1230
		 		String strName_reftype = elRef_type.getAttributeValue("name");
1231

    
1232
				if (strName_reftype.equals("Report")) {
1233
					map_report.put(place, report);
1234
					Reference give_report = map_report.get(place);
1235
					give_report.setPlacePublished(place);
1236
					reference=give_report;
1237
				}else if (strName_reftype.equals("Book")){
1238
					map_book.put(place, book);
1239
					Reference give_book = map_book.get(place);
1240
					give_book.setPlacePublished(place);
1241
					reference=give_book;
1242
				}else if (strName_reftype.equals("Thesis")){
1243
					map_thesis.put(place, thesis);
1244
					Reference give_thesis = map_thesis.get(place);
1245
					give_thesis.setPlacePublished(place);
1246
					reference=give_thesis;
1247
				}else if (strName_reftype.equalsIgnoreCase("Conference Proceedings")){
1248
					map_proceedings.put(place, proceedings);
1249
					Reference give_proceedings = map_proceedings.get(place);
1250
					give_proceedings.setPlacePublished(place);
1251
					reference=give_proceedings;
1252
				}else if (strName_reftype.equalsIgnoreCase("Database")){
1253
					map_database.put(place, database);
1254
					Reference give_database = map_database.get(place);
1255
					give_database.setPlacePublished(place);
1256
					reference=give_database;
1257
				}else if (strName_reftype.equalsIgnoreCase("CdDvd")){
1258
					map_cdDvd.put(place, cdDvd);
1259
					Reference give_cdDvd = map_cdDvd.get(place);
1260
					give_cdDvd.setPlacePublished(place);
1261
					reference=give_cdDvd;
1262
				}else if (strName_reftype.equalsIgnoreCase("Print Series")){
1263
					map_printSeries.put(place, printSeries);
1264
					Reference give_printSeries = map_printSeries.get(place);
1265
					give_printSeries.setPlacePublished(place);
1266
					reference=give_printSeries;
1267
				}else if (strName_reftype.equalsIgnoreCase("Journal")){
1268
					map_journal.put(place, journal);
1269
					Reference give_journal = map_journal.get(place);
1270
					give_journal.setPlacePublished(place);
1271
					reference=give_journal;
1272
				} else {
1273
					logger.warn("The type was not found...");
1274
					map_generic.put(place, generic);
1275
					Reference give_generic = map_generic.get(place);
1276
					give_generic.setPlacePublished(place);
1277
					reference=give_generic;
1278
					success = false;
1279
				}
1280
		 	}
1281

    
1282
			logger.info("start make publisher ...");
1283
			childName = "publisher";
1284
			obligatory = false;
1285
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1286
			success &= doubleResult.getSecondResult();
1287
			Element elPublisher = doubleResult.getFirstResult();
1288
			if (elPublisher != null) {
1289

    
1290
				childName = "style";
1291
				obligatory = false;
1292
				doubleResult =  XmlHelp.getSingleChildElement(elPublisher, childName, tcsNamespace, obligatory);
1293
				success &= doubleResult.getSecondResult();
1294
				Element elStyle_Publisher = doubleResult.getFirstResult();
1295
				String strColor_Publisher = elStyle_Publisher.getAttributeValue("color");
1296
				String strFace_Publisher = elStyle_Publisher.getAttributeValue("face");
1297
				String strFont_Publisher = elStyle_Publisher.getAttributeValue("font");
1298
				String strSize_Publisher = elStyle_Publisher.getAttributeValue("size");
1299

    
1300
				String publisher = elStyle_Publisher.getTextNormalize();
1301
				String strName_reftype = elRef_type.getAttributeValue("name");
1302

    
1303
				if (strName_reftype.equals("Report")) {
1304
					map_report.put(publisher, report);
1305
					Reference give_report = map_report.get(publisher);
1306
					give_report.setPublisher(publisher);
1307
					reference=give_report;
1308
				}else if (strName_reftype.equals("Book")){
1309
					map_book.put(publisher, book);
1310
					Reference give_book = map_book.get(publisher);
1311
					give_book.setPublisher(publisher);
1312
					reference=give_book;
1313
				}else if (strName_reftype.equals("Book Section")){
1314
					if (publisher != null) {
1315
						bookSection.setInBook(book);
1316
						book.setPublisher(publisher);
1317
						reference= bookSection;
1318
					}
1319
				}else if (strName_reftype.equals("Thesis")){
1320
					map_thesis.put(publisher, thesis);
1321
					Reference give_thesis = map_thesis.get(publisher);
1322
					give_thesis.setPublisher(publisher);
1323
					reference=give_thesis;
1324
				}else if (strName_reftype.equalsIgnoreCase("Conference Proceedings")){
1325
					map_proceedings.put(publisher, proceedings);
1326
					Reference give_proceedings = map_proceedings.get(publisher);
1327
					give_proceedings.setPublisher(publisher);
1328
					reference=give_proceedings;
1329
				}else if (strName_reftype.equalsIgnoreCase("Database")){
1330
					map_database.put(publisher, database);
1331
					Reference give_database = map_database.get(publisher);
1332
					give_database.setPublisher(publisher);
1333
					reference=give_database;
1334
				}else if (strName_reftype.equalsIgnoreCase("CdDvd")){
1335
					map_cdDvd.put(publisher, cdDvd);
1336
					Reference give_cdDvd = map_cdDvd.get(publisher);
1337
					give_cdDvd.setPublisher(publisher);
1338
					reference=give_cdDvd;
1339
				}else if (strName_reftype.equalsIgnoreCase("Print Series")){
1340
					map_printSeries.put(publisher, printSeries);
1341
					Reference give_printSeries = map_printSeries.get(publisher);
1342
					give_printSeries.setPublisher(publisher);
1343
					reference=give_printSeries;
1344
				}else if (strName_reftype.equalsIgnoreCase("Journal")){
1345
					map_journal.put(publisher, journal);
1346
					Reference give_journal = map_journal.get(publisher);
1347
					give_journal.setPublisher(publisher);
1348
					reference=give_journal;
1349
				}else if (strName_reftype.equalsIgnoreCase("Journal Article")){
1350
					if (publisher != null) {
1351
						article.setInJournal(journal);
1352
						journal.setPublisher(publisher);
1353
						reference= article;
1354
					}
1355
				} else {
1356
					logger.warn("The type was not found...");
1357
					map_generic.put(publisher, generic);
1358
					Reference give_generic = map_generic.get(publisher);
1359
					give_generic.setPublisher(publisher);
1360
					reference=give_generic;
1361

    
1362
					success = false;
1363
				}
1364
			}
1365

    
1366
			/**
1367
			// It was not used in this Implementation
1368
			childName = "orig-pub"; // original grant number - the name in Endnote Programm
1369
			obligatory = false;
1370
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1371
			success &= doubleResult.getSecondResult();
1372
			Element elOrig_pub = doubleResult.getFirstResult();
1373
			if (elOrig_pub != null) {
1374

    
1375
				childName = "style";
1376
				obligatory = false;
1377
				doubleResult =  XmlHelp.getSingleChildElement(elOrig_pub, childName, tcsNamespace, obligatory);
1378
				success &= doubleResult.getSecondResult();
1379
				Element elStyle_Orig_pub = doubleResult.getFirstResult();
1380
				String strColor_Orig_pub = elStyle_Orig_pub.getAttributeValue("color");
1381
				String strFace_Orig_pub = elStyle_Orig_pub.getAttributeValue("face");
1382
				String strFont_Orig_pub = elStyle_Orig_pub.getAttributeValue("font");
1383
				String strSize_Orig_pub = elStyle_Orig_pub.getAttributeValue("size");
1384
			}
1385
			*/
1386

    
1387
			logger.info("start make ISBN/ISNN ...");
1388
			childName = "isbn";
1389
			obligatory = false;
1390
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1391
			success &= doubleResult.getSecondResult();
1392
			Element elIsbn = doubleResult.getFirstResult();
1393

    
1394
			if (elIsbn != null) {
1395

    
1396
				childName = "style";
1397
				obligatory = false;
1398
				doubleResult =  XmlHelp.getSingleChildElement(elIsbn, childName, tcsNamespace, obligatory);
1399
				success &= doubleResult.getSecondResult();
1400
				Element elStyle_Isbn = doubleResult.getFirstResult();
1401
				String strColor_Isbn = elStyle_Isbn.getAttributeValue("color");
1402
				String strFace_Isbn = elStyle_Isbn.getAttributeValue("face");
1403
				String strFont_Isbn = elStyle_Isbn.getAttributeValue("font");
1404
				String strSize_Isbn = elStyle_Isbn.getAttributeValue("size");
1405

    
1406
				String strName_reftype = elRef_type.getAttributeValue("name");
1407
				String page = elStyle_Isbn.getTextNormalize();
1408

    
1409
				if (strName_reftype.equals("Book")) {
1410
					map_book.put(page, book);
1411
					Reference give_book = map_book.get(page);
1412
					give_book.setIsbn(page);
1413
					reference=give_book;
1414
				}else if (strName_reftype.equals("Journal")){
1415
					map_journal.put(page, journal);
1416
					Reference give_journal = map_journal.get(page);
1417
					give_journal.setIssn(page);
1418
					reference=give_journal;
1419
				}else {
1420
					logger.warn("The type was not found...");
1421
					success = false;
1422
				}
1423
			}
1424

    
1425
			/**
1426
			// It was not used in this Implementation
1427
			childName = "accession-num";
1428
			obligatory = false;
1429
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1430
			success &= doubleResult.getSecondResult();
1431
			Element elAccession_num = doubleResult.getFirstResult();
1432
			if (elAccession_num != null) {
1433

    
1434
				childName = "style";
1435
				obligatory = false;
1436
				doubleResult =  XmlHelp.getSingleChildElement(elAccession_num, childName, tcsNamespace, obligatory);
1437
				success &= doubleResult.getSecondResult();
1438
				Element elStyle_Accession_num = doubleResult.getFirstResult();
1439
				String strColor_Accession_num = elStyle_Accession_num.getAttributeValue("color");
1440
				String strFace_Accession_num = elStyle_Accession_num.getAttributeValue("face");
1441
				String strFont_Accession_num = elStyle_Accession_num.getAttributeValue("font");
1442
				String strSize_Accession_num = elStyle_Accession_num.getAttributeValue("size");
1443
			}
1444

    
1445
			// It was not used in this Implementation
1446
			childName = "call-num";
1447
			obligatory = false;
1448
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1449
			success &= doubleResult.getSecondResult();
1450
			Element elCall_num = doubleResult.getFirstResult();
1451
			if (elCall_num != null) {
1452

    
1453
				childName = "style";
1454
				obligatory = false;
1455
				doubleResult =  XmlHelp.getSingleChildElement(elCall_num, childName, tcsNamespace, obligatory);
1456
				success &= doubleResult.getSecondResult();
1457
				Element elStyle_Call_num = doubleResult.getFirstResult();
1458
				String strColor_Call_num = elStyle_Call_num.getAttributeValue("color");
1459
				String strFace_Call_num = elStyle_Call_num.getAttributeValue("face");
1460
				String strFont_Call_num = elStyle_Call_num.getAttributeValue("font");
1461
				String strSize_Call_num = elStyle_Call_num.getAttributeValue("size");
1462
			}
1463
			*/
1464

    
1465
			logger.info("start make electronic-resource-num ...");
1466
			childName = "electronic-resource-num";  //DOI - the name in Endnote Programm
1467
			obligatory = false;
1468
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1469
			success &= doubleResult.getSecondResult();
1470
			Element elElectronic_resource_num = doubleResult.getFirstResult();
1471
			if (elElectronic_resource_num != null) {
1472

    
1473
				childName = "style";
1474
				obligatory = false;
1475
				doubleResult =  XmlHelp.getSingleChildElement(elElectronic_resource_num, childName, tcsNamespace, obligatory);
1476
				success &= doubleResult.getSecondResult();
1477
				Element elStyle_Electronic_resource_num = doubleResult.getFirstResult();
1478
				String strColor_Electronic_resource_num = elStyle_Electronic_resource_num.getAttributeValue("color");
1479
				String strFace_Electronic_resource_num = elStyle_Electronic_resource_num.getAttributeValue("face");
1480
				String strFont_Electronic_resource_num = elStyle_Electronic_resource_num.getAttributeValue("font");
1481
				String strSize_Electronic_resource_num = elStyle_Electronic_resource_num.getAttributeValue("size");
1482

    
1483
				String dOI = elStyle_Electronic_resource_num.getTextNormalize();
1484
				reference.addExtension(dOI, ExtensionType.DOI());
1485
			}
1486

    
1487
			logger.info("start make abstract ...");
1488
			childName = "abstract";
1489
			obligatory = false;
1490
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1491
			success &= doubleResult.getSecondResult();
1492
			Element elAbstract = doubleResult.getFirstResult();
1493
			if (elAbstract != null) {
1494

    
1495
				childName = "style";
1496
				obligatory = false;
1497
				doubleResult =  XmlHelp.getSingleChildElement(elAbstract, childName, tcsNamespace, obligatory);
1498
				success &= doubleResult.getSecondResult();
1499
				Element elStyle_Abstract = doubleResult.getFirstResult();
1500
				String strColor_Abstract = elStyle_Abstract.getAttributeValue("color");
1501
				String strFace_Abstract = elStyle_Abstract.getAttributeValue("face");
1502
				String strFont_Abstract = elStyle_Abstract.getAttributeValue("font");
1503
				String strSize_Abstract = elStyle_Abstract.getAttributeValue("size");
1504

    
1505
				String annote = elStyle_Abstract.getTextNormalize();
1506
				Annotation annotation = Annotation.NewInstance(annote, Language.DEFAULT());
1507
				if (annote!= null) {
1508
					reference.addAnnotation(annotation);
1509
				}
1510
				else {
1511
					logger.warn("The type was not found...");
1512
					success = false;
1513
				}
1514
			}
1515

    
1516
			/**
1517
			// It was not used in this Implementation
1518
			childName = "label";
1519
			obligatory = false;
1520
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1521
			success &= doubleResult.getSecondResult();
1522
			Element elLabel = doubleResult.getFirstResult();
1523
			if (elLabel != null) {
1524

    
1525
				childName = "style";
1526
				obligatory = false;
1527
				doubleResult =  XmlHelp.getSingleChildElement(elLabel, childName, tcsNamespace, obligatory);
1528
				success &= doubleResult.getSecondResult();
1529
				Element elStyle_Label = doubleResult.getFirstResult();
1530
				String strColor_Label = elStyle_Label.getAttributeValue("color");
1531
				String strFace_Label = elStyle_Label.getAttributeValue("face");
1532
				String strFont_Label = elStyle_Label.getAttributeValue("font");
1533
				String strSize_Label = elStyle_Label.getAttributeValue("size");
1534
			}
1535

    
1536

    
1537
			// It was not used in this Implementation
1538
	     	logger.info("start make image ...");
1539
			childName = "image"; //Figure - the name in Endnote Programm
1540
			obligatory = false;
1541
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1542
			success &= doubleResult.getSecondResult();
1543
			Element elImage = doubleResult.getFirstResult();
1544

    
1545
			Media media = Media.NewInstance();
1546
			if (elImage != null){
1547
				String strFile = elImage.getAttributeValue("file");
1548
				String strImage_name = elImage.getAttributeValue("name");
1549
				reference.getMedia();
1550
			}
1551

    
1552

    
1553
			/**
1554
			//It was not used in this Implementation
1555
			childName = "caption";
1556
			obligatory = false;
1557
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1558
			success &= doubleResult.getSecondResult();
1559
			Element elCaption = doubleResult.getFirstResult();
1560
			if(elCaption != null) {
1561

    
1562
				childName = "style";
1563
				obligatory = false;
1564
				doubleResult =  XmlHelp.getSingleChildElement(elCaption, childName, tcsNamespace, obligatory);
1565
				success &= doubleResult.getSecondResult();
1566
				Element elStyle_Caption = doubleResult.getFirstResult();
1567
				String strColor_Caption = elStyle_Caption.getAttributeValue("color");
1568
				String strFace_Caption = elStyle_Caption.getAttributeValue("face");
1569
				String strFont_Caption = elStyle_Caption.getAttributeValue("font");
1570
				String strSize_Caption = elStyle_Caption.getAttributeValue("size");
1571
			}
1572

    
1573
			//It was not used in this Implementation
1574
			childName = "notes";
1575
			obligatory = false;
1576
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1577
			success &= doubleResult.getSecondResult();
1578
			Element elNotes = doubleResult.getFirstResult();
1579
			if (elNotes != null) {
1580

    
1581
				childName = "style";
1582
				obligatory = false;
1583
				doubleResult =  XmlHelp.getSingleChildElement(elNotes, childName, tcsNamespace, obligatory);
1584
				success &= doubleResult.getSecondResult();
1585
				Element elStyle_Notes = doubleResult.getFirstResult();
1586
				String strColor_Notes = elStyle_Notes.getAttributeValue("color");
1587
				String strFace_Notes = elStyle_Notes.getAttributeValue("face");
1588
				String strFont_Notes = elStyle_Notes.getAttributeValue("font");
1589
				String strSize_Notes = elStyle_Notes.getAttributeValue("size");
1590

    
1591
				//Annotation annotation = null;
1592
				//reference.addAnnotation(annotation);
1593
				//referenceMap.put(elStyle_Notes, reference);
1594
			}
1595

    
1596
			//It was not used in this Implementation
1597
			childName = "research-notes";
1598
			obligatory = false;
1599
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1600
			success &= doubleResult.getSecondResult();
1601
			Element elResearch_notes = doubleResult.getFirstResult();
1602
			if (elResearch_notes != null) {
1603

    
1604
				childName = "style";
1605
				obligatory = false;
1606
				doubleResult =  XmlHelp.getSingleChildElement(elResearch_notes, childName, tcsNamespace, obligatory);
1607
				success &= doubleResult.getSecondResult();
1608
				Element elStyle_Research_notes = doubleResult.getFirstResult();
1609
				String strColor_Research_notes = elStyle_Research_notes.getAttributeValue("color");
1610
				String strFace_Research_notes = elStyle_Research_notes.getAttributeValue("face");
1611
				String strFont_Research_notes = elStyle_Research_notes.getAttributeValue("font");
1612
				String strSize_Research_notes = elStyle_Research_notes.getAttributeValue("size");
1613
			}
1614
			*/
1615

    
1616
			/**It was not used in this Implementation
1617
			childName = "work-type"; // thesis type
1618
			obligatory = false;
1619
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1620
			success &= doubleResult.getSecondResult();
1621
			Element elWork_type = doubleResult.getFirstResult();
1622
			if (elWork_type!= null) {
1623

    
1624
				childName = "style";
1625
				obligatory = false;
1626
				doubleResult =  XmlHelp.getSingleChildElement(elWork_type, childName, tcsNamespace, obligatory);
1627
				success &= doubleResult.getSecondResult();
1628
				Element elStyle_Work_type = doubleResult.getFirstResult();
1629
				String strColor_Work_type = elStyle_Work_type.getAttributeValue("color");
1630
				String strFace_Work_type = elStyle_Work_type.getAttributeValue("face");
1631
				String strFont_Work_type = elStyle_Work_type.getAttributeValue("font");
1632
				String strSize_Work_type = elStyle_Work_type.getAttributeValue("size");
1633

    
1634
				String thesis_style =  elStyle_Work_type.getTextNormalize();
1635
				String strName_reftype = elRef_type.getAttributeValue("name");
1636

    
1637
				Institution institution =Institution.NewInstance();
1638
				school.setName(thesis_style);
1639
				institution.setName(thesis_style);
1640

    
1641
				if (strName_reftype.equals("Thesis")) {
1642
					thesis.setSchool(institution);
1643
					reference= thesis;
1644
				}else if (strName_reftype.equals("Report")){
1645
					report.setInstitution(institution);
1646
					reference= report;
1647
				}else {
1648
					logger.warn("The type was not found...");
1649
					success = false;
1650
					logger.info(reference);
1651
				}
1652
				logger.info(reference);
1653
			}
1654

    
1655
			/**
1656
			//It was not used in this Implementation
1657
			childName = "reviewed-item";
1658
			obligatory = false;
1659
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1660
			success &= doubleResult.getSecondResult();
1661
			Element elReviewed_item = doubleResult.getFirstResult();
1662
			if(elReviewed_item!=null) {
1663

    
1664
				childName = "style";
1665
				obligatory = false;
1666
				doubleResult =  XmlHelp.getSingleChildElement(elReviewed_item, childName, tcsNamespace, obligatory);
1667
				success &= doubleResult.getSecondResult();
1668
				Element elStyle_Reviewed_item = doubleResult.getFirstResult();
1669
				String strColor_Reviewed_item = elStyle_Reviewed_item.getAttributeValue("color");
1670
				String strFace_Reviewed_item = elStyle_Reviewed_item.getAttributeValue("face");
1671
				String strFont_Reviewed_item = elStyle_Reviewed_item.getAttributeValue("font");
1672
				String strSize_Reviewed_item = elStyle_Reviewed_item.getAttributeValue("size");
1673
			}
1674

    
1675
			//It was not used in this Implementation
1676
			childName = "remote-database-name"; //name of database - the name in endnote programm
1677
			obligatory = false;
1678
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1679
			success &= doubleResult.getSecondResult();
1680
			Element elRemote_database_name = doubleResult.getFirstResult();
1681
			if (elRemote_database_name != null) {
1682

    
1683
				childName = "style";
1684
				obligatory = false;
1685
				doubleResult =  XmlHelp.getSingleChildElement(elRemote_database_name, childName, tcsNamespace, obligatory);
1686
				success &= doubleResult.getSecondResult();
1687
				Element elStyle_Remote_database_name = doubleResult.getFirstResult();
1688
				String strColor_Remote_database_name = elStyle_Remote_database_name.getAttributeValue("color");
1689
				String strFace_Remote_database_name = elStyle_Remote_database_name.getAttributeValue("face");
1690
				String strFont_Remote_database_name = elStyle_Remote_database_name.getAttributeValue("font");
1691
				String strSize_Remote_database_name = elStyle_Remote_database_name.getAttributeValue("size");
1692
			}
1693

    
1694
			//It was not used in this Implementation
1695
			childName = "remote-database-provider"; // database provider - the name in endnote programm
1696
			obligatory = false;
1697
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1698
			success &= doubleResult.getSecondResult();
1699
			Element elRemote_database_provider = doubleResult.getFirstResult();
1700
			if (elRemote_database_provider != null) {
1701

    
1702
				childName = "style";
1703
				obligatory = false;
1704
				doubleResult =  XmlHelp.getSingleChildElement(elRemote_database_provider, childName, tcsNamespace, obligatory);
1705
				success &= doubleResult.getSecondResult();
1706
				Element elStyle_Remote_database_provider = doubleResult.getFirstResult();
1707
				String strColor_Remote_database_provider = elStyle_Remote_database_provider.getAttributeValue("color");
1708
				String strFace_Remote_database_provider = elStyle_Remote_database_provider.getAttributeValue("face");
1709
				String strFont_Remote_database_provider = elStyle_Remote_database_provider.getAttributeValue("font");
1710
				String strSize_Remote_database_provider = elStyle_Remote_database_provider.getAttributeValue("size");
1711
			}
1712
			*/
1713

    
1714
			childName = "language";
1715
			obligatory = false;
1716
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1717
			success &= doubleResult.getSecondResult();
1718
			Element elLanguage = doubleResult.getFirstResult();
1719
			if (elLanguage != null) {
1720

    
1721
				childName = "style";
1722
				obligatory = false;
1723
				doubleResult =  XmlHelp.getSingleChildElement(elLanguage, childName, tcsNamespace, obligatory);
1724
				success &= doubleResult.getSecondResult();
1725
				Element elStyle_Language = doubleResult.getFirstResult();
1726
				String strColor_Language = elStyle_Language.getAttributeValue("color");
1727
				String strFace_Language = elStyle_Language.getAttributeValue("face");
1728
				String strFont_Language = elStyle_Language.getAttributeValue("font");
1729
				String strSize_Language = elStyle_Language.getAttributeValue("size");
1730
				String label =  elStyle_Language.getTextNormalize();
1731

    
1732
				Language language =  Language.NewInstance();
1733
				language.setLabel(label);
1734
			}
1735

    
1736

    
1737
			logger.info("start make urls ...");
1738
			childName = "urls";
1739
			obligatory = false;
1740
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1741
			success &= doubleResult.getSecondResult();
1742
			Element elUrls = doubleResult.getFirstResult();
1743
			if (elUrls != null) {
1744
				childName = "web-urls";
1745
				obligatory = false;
1746
				doubleResult =  XmlHelp.getSingleChildElement(elUrls, childName, tcsNamespace, obligatory);
1747
				success &= doubleResult.getSecondResult();
1748
				Element elWeb_urls = doubleResult.getFirstResult();
1749

    
1750
				childName = "url";
1751
				obligatory = false;
1752
				doubleResult =  XmlHelp.getSingleChildElement(elWeb_urls, childName, tcsNamespace, obligatory);
1753
				success &= doubleResult.getSecondResult();
1754
				Element elUrl = doubleResult.getFirstResult();
1755
				if (elUrl != null) {
1756
					String strHas_ut = elUrl.getAttributeValue("has-ut");
1757
					String strPpv_app = elUrl.getAttributeValue("ppv-app");
1758
					String strPpv_ref = elUrl.getAttributeValue("ppv-ref");
1759
					String strPpv_ut = elUrl.getAttributeValue("ppv-ut");
1760

    
1761
					childName = "style";
1762
					obligatory = false;
1763
					doubleResult =  XmlHelp.getSingleChildElement(elUrl, childName, tcsNamespace, obligatory);
1764
					success &= doubleResult.getSecondResult();
1765
					Element elStyle_Url = doubleResult.getFirstResult();
1766
					String strColor_Url = elStyle_Url.getAttributeValue("color");
1767
					String strFace_Url = elStyle_Url.getAttributeValue("face");
1768
					String strFont_Url = elStyle_Url.getAttributeValue("font");
1769
					String strSize_Url = elStyle_Url.getAttributeValue("size");
1770
					try {
1771
						reference.setUri(new URI(elStyle_Url.getTextNormalize()));
1772
					} catch (URISyntaxException e) {
1773
						logger.warn("Unvalid URL:" + elStyle_Url.getText());
1774
						success = false;
1775
					}
1776
				}
1777

    
1778
				childName = "pdf-urls";
1779
				obligatory = false;
1780
				doubleResult =  XmlHelp.getSingleChildElement(elUrls, childName, tcsNamespace, obligatory);
1781
				success &= doubleResult.getSecondResult();
1782
				Element elPdf_urls = doubleResult.getFirstResult();
1783

    
1784
				childName = "url";
1785
				obligatory = false;
1786
				doubleResult =  XmlHelp.getSingleChildElement(elPdf_urls, childName, tcsNamespace, obligatory);
1787
				success &= doubleResult.getSecondResult();
1788
				Element elPdfUrl = doubleResult.getFirstResult();
1789
				if (elPdfUrl !=null) {
1790
					String strHas_ut_pdf = elPdfUrl.getAttributeValue("has-ut");
1791
					String strPpv_app_pdf = elPdfUrl.getAttributeValue("ppv-app");
1792
					String strPpv_ref_pdf = elPdfUrl.getAttributeValue("ppv-ref");
1793
					String strPpv_ut_pdf = elPdfUrl.getAttributeValue("ppv-ut");
1794

    
1795
					childName = "style";
1796
					obligatory = false;
1797
					doubleResult =  XmlHelp.getSingleChildElement(elPdfUrl, childName, tcsNamespace, obligatory);
1798
					success &= doubleResult.getSecondResult();
1799
					Element elStyle_PdfUrl = doubleResult.getFirstResult();
1800
					String strColor_PdfUrl = elStyle_PdfUrl.getAttributeValue("color");
1801
					String strFace_PdfUrl = elStyle_PdfUrl.getAttributeValue("face");
1802
					String strFont_PdfUrl = elStyle_PdfUrl.getAttributeValue("font");
1803
					String strSize_PdfUrl = elStyle_PdfUrl.getAttributeValue("size");
1804
					try {
1805
						reference.setUri(new URI(elStyle_PdfUrl.getText()));
1806
					} catch (URISyntaxException e) {
1807
						logger.warn("Unvalid URL:" + elStyle_PdfUrl.getText());
1808
						success = false;
1809
					}
1810
				}
1811

    
1812
				childName = "text-urls";
1813
				obligatory = false;
1814
				doubleResult =  XmlHelp.getSingleChildElement(elUrls, childName, tcsNamespace, obligatory);
1815
				success &= doubleResult.getSecondResult();
1816
				Element elText_urls = doubleResult.getFirstResult();
1817

    
1818
				childName = "url";
1819
				obligatory = false;
1820
				doubleResult =  XmlHelp.getSingleChildElement(elText_urls, childName, tcsNamespace, obligatory);
1821
				success &= doubleResult.getSecondResult();
1822
				Element elTextUrl = doubleResult.getFirstResult();
1823
				if (elTextUrl != null) {
1824
					String strHas_ut_text = elTextUrl.getAttributeValue("has-ut");
1825
					String strPpv_app_text = elTextUrl.getAttributeValue("ppv-app");
1826
					String strPpv_ref_text = elTextUrl.getAttributeValue("ppv-ref");
1827
					String strPpv_ut_text = elTextUrl.getAttributeValue("ppv-ut");
1828

    
1829
					childName = "style";
1830
					obligatory = false;
1831
					doubleResult =  XmlHelp.getSingleChildElement(elTextUrl, childName, tcsNamespace, obligatory);
1832
					success &= doubleResult.getSecondResult();
1833
					Element elStyle_TextUrl = doubleResult.getFirstResult();
1834
					String strColor_TextUrl = elStyle_TextUrl.getAttributeValue("color");
1835
					String strFace_TextUrl = elStyle_TextUrl.getAttributeValue("face");
1836
					String strFont_TextUrl = elStyle_TextUrl.getAttributeValue("font");
1837
					String strSize_TextUrl = elStyle_TextUrl.getAttributeValue("size");
1838
					try {
1839
						reference.setUri(new URI(elStyle_TextUrl.getText()));
1840
					} catch (URISyntaxException e) {
1841
						logger.warn("Unvalid URL:" + elStyle_TextUrl.getText());
1842
						success = false;
1843
					}
1844
				}
1845

    
1846
				childName = "related-urls";
1847
				obligatory = false;
1848
				doubleResult =  XmlHelp.getSingleChildElement(elUrls, childName, tcsNamespace, obligatory);
1849
				success &= doubleResult.getSecondResult();
1850
				Element elRelated_urls = doubleResult.getFirstResult();
1851

    
1852
				childName = "url";
1853
				obligatory = false;
1854
				doubleResult =  XmlHelp.getSingleChildElement(elRelated_urls, childName, tcsNamespace, obligatory);
1855
				success &= doubleResult.getSecondResult();
1856
				Element elRelatedUrl = doubleResult.getFirstResult();
1857
				if (elRelatedUrl != null) {
1858

    
1859
					String strHas_ut_related = elRelatedUrl.getAttributeValue("has-ut");
1860
					String strPpv_app_related = elRelatedUrl.getAttributeValue("ppv-app");
1861
					String strPpv_ref_related = elRelatedUrl.getAttributeValue("ppv-ref");
1862
					String strPpv_ut_related = elRelatedUrl.getAttributeValue("ppv-ut");
1863

    
1864
					childName = "style";
1865
					obligatory = false;
1866
					doubleResult =  XmlHelp.getSingleChildElement(elRelatedUrl, childName, tcsNamespace, obligatory);
1867
					success &= doubleResult.getSecondResult();
1868
					Element elStyle_RelatedUrl = doubleResult.getFirstResult();
1869
					String strColor_RelatedUrl = elStyle_RelatedUrl.getAttributeValue("color");
1870
					String strFace_RelatedUrl = elStyle_RelatedUrl.getAttributeValue("face");
1871
					String strFont_RelatedUrl = elStyle_RelatedUrl.getAttributeValue("font");
1872
					String strSize_RelatedUrl = elStyle_RelatedUrl.getAttributeValue("size");
1873
					try {
1874
						reference.setUri(new URI(elStyle_RelatedUrl.getText()));
1875
					} catch (URISyntaxException e) {
1876
						logger.warn("Unvalid URL:" + elStyle_RelatedUrl.getText());
1877
						success = false;
1878
					}
1879
				}
1880

    
1881
				childName = "image-urls";
1882
				obligatory = false;
1883
				doubleResult =  XmlHelp.getSingleChildElement(elUrls, childName, tcsNamespace, obligatory);
1884
				success &= doubleResult.getSecondResult();
1885
				Element elImage_urls = doubleResult.getFirstResult();
1886

    
1887
				childName = "url";
1888
				obligatory = false;
1889
				doubleResult =  XmlHelp.getSingleChildElement(elImage_urls, childName, tcsNamespace, obligatory);
1890
				success &= doubleResult.getSecondResult();
1891
				Element elImageUrl = doubleResult.getFirstResult();
1892
				if (elImageUrl != null) {
1893

    
1894
					String strHas_ut_image = elImageUrl.getAttributeValue("has-ut");
1895
					String strPpv_app_image = elImageUrl.getAttributeValue("ppv-app");
1896
					String strPpv_ref_image = elImageUrl.getAttributeValue("ppv-ref");
1897
					String strPpv_ut_image = elImageUrl.getAttributeValue("ppv-ut");
1898

    
1899
					childName = "style";
1900
					obligatory = false;
1901
					doubleResult =  XmlHelp.getSingleChildElement(elImageUrl, childName, tcsNamespace, obligatory);
1902
					success &= doubleResult.getSecondResult();
1903
					Element elStyle_ImageUrl = doubleResult.getFirstResult();
1904
					String strColor_ImageUrl = elStyle_ImageUrl.getAttributeValue("color");
1905
					String strFace_ImageUrl = elStyle_ImageUrl.getAttributeValue("face");
1906
					String strFont_ImageUrl = elStyle_ImageUrl.getAttributeValue("font");
1907
					String strSize_ImageUrl = elStyle_ImageUrl.getAttributeValue("size");
1908
					try {
1909
						reference.setUri(new URI(elStyle_ImageUrl.getText()));
1910
					} catch (URISyntaxException e) {
1911
						logger.warn("Unvalid URL:" + elStyle_ImageUrl.getText());
1912
						success = false;
1913
					}
1914
				}
1915
			}
1916

    
1917
			/** It was not used in this Implementation
1918
			childName = "access-date";
1919
			obligatory = false;
1920
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1921
			success &= doubleResult.getSecondResult();
1922
			Element elAccess_date = doubleResult.getFirstResult();
1923
			if (elAccess_date != null) {
1924

    
1925
				childName = "style";
1926
				obligatory = false;
1927
				doubleResult =  XmlHelp.getSingleChildElement(elAccess_date, childName, tcsNamespace, obligatory);
1928
				success &= doubleResult.getSecondResult();
1929
				Element elStyle_Access_date = doubleResult.getFirstResult();
1930
				String strColor_Access_date = elStyle_Access_date.getAttributeValue("color");
1931
				String strFace_Access_date = elStyle_Access_date.getAttributeValue("face");
1932
				String strFont_Access_date = elStyle_Access_date.getAttributeValue("font");
1933
				String strSize_Access_date = elStyle_Access_date.getAttributeValue("size");
1934
			}
1935

    
1936

    
1937
			//It was not used in this Implementation
1938
			logger.info("start make modified-date ...");
1939
			childName = "modified-date"; //custom 8 - name in endnote programm
1940
			obligatory = false;
1941
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1942
			success &= doubleResult.getSecondResult();
1943
			Element elModified_date = doubleResult.getFirstResult();
1944
			if (elModified_date != null) {
1945

    
1946
				childName = "style";
1947
				obligatory = false;
1948
				doubleResult =  XmlHelp.getSingleChildElement(elModified_date, childName, tcsNamespace, obligatory);
1949
				success &= doubleResult.getSecondResult();
1950
				Element elStyle_Modified_date = doubleResult.getFirstResult();
1951
				String strColor_Modified_date = elStyle_Modified_date.getAttributeValue("color");
1952
				String strFace_Modified_date = elStyle_Modified_date.getAttributeValue("face");
1953
				String strFont_Modified_date = elStyle_Modified_date.getAttributeValue("font");
1954
				String strSize_Modified_date = elStyle_Modified_date.getAttributeValue("size");
1955
			}
1956

    
1957
			/**It was not used in this Implementation
1958
			childName = "custom1";
1959
			obligatory = false;
1960
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1961
			success &= doubleResult.getSecondResult();
1962
			Element elCustom1 = doubleResult.getFirstResult();
1963
			if (elCustom1 != null) {
1964

    
1965
				childName = "style";
1966
				obligatory = false;
1967
				doubleResult =  XmlHelp.getSingleChildElement(elCustom1, childName, tcsNamespace, obligatory);
1968
				success &= doubleResult.getSecondResult();
1969
				Element elStyle_Custom1 = doubleResult.getFirstResult();
1970
				String strColor_Custom1 = elStyle_Custom1.getAttributeValue("color");
1971
				String strFace_Custom1 = elStyle_Custom1.getAttributeValue("face");
1972
				String strFont_Custom1 = elStyle_Custom1.getAttributeValue("font");
1973
				String strSize_Custom1 = elStyle_Custom1.getAttributeValue("size");
1974
			}
1975

    
1976
			childName = "custom2";
1977
			obligatory = false;
1978
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1979
			success &= doubleResult.getSecondResult();
1980
			Element elCustom2 = doubleResult.getFirstResult();
1981
			if (elCustom2 != null) {
1982

    
1983
				childName = "style";
1984
				obligatory = false;
1985
				doubleResult =  XmlHelp.getSingleChildElement(elCustom2, childName, tcsNamespace, obligatory);
1986
				success &= doubleResult.getSecondResult();
1987
				Element elStyle_Custom2 = doubleResult.getFirstResult();
1988
				String strColor_Custom2 = elStyle_Custom2.getAttributeValue("color");
1989
				String strFace_Custom2 = elStyle_Custom2.getAttributeValue("face");
1990
				String strFont_Custom2 = elStyle_Custom2.getAttributeValue("font");
1991
				String strSize_Custom2 = elStyle_Custom2.getAttributeValue("size");
1992
			}
1993

    
1994
			childName = "custom3";
1995
			obligatory = false;
1996
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
1997
			success &= doubleResult.getSecondResult();
1998
			Element elCustom3 = doubleResult.getFirstResult();
1999
			if (elCustom3 != null) {
2000

    
2001
				childName = "style";
2002
				obligatory = false;
2003
				doubleResult =  XmlHelp.getSingleChildElement(elCustom3, childName, tcsNamespace, obligatory);
2004
				success &= doubleResult.getSecondResult();
2005
				Element elStyle_Custom3 = doubleResult.getFirstResult();
2006
				String strColor_Custom3 = elStyle_Custom3.getAttributeValue("color");
2007
				String strFace_Custom3 = elStyle_Custom3.getAttributeValue("face");
2008
				String strFont_Custom3 = elStyle_Custom3.getAttributeValue("font");
2009
				String strSize_Custom3 = elStyle_Custom3.getAttributeValue("size");
2010
			}
2011

    
2012
			childName = "custom4";
2013
			obligatory = false;
2014
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
2015
			success &= doubleResult.getSecondResult();
2016
			Element elCustom4 = doubleResult.getFirstResult();
2017
			if (elCustom4 != null) {
2018

    
2019
				childName = "style";
2020
				obligatory = false;
2021
				doubleResult =  XmlHelp.getSingleChildElement(elCustom4, childName, tcsNamespace, obligatory);
2022
				success &= doubleResult.getSecondResult();
2023
				Element elStyle_Custom4 = doubleResult.getFirstResult();
2024
				String strColor_Custom4 = elStyle_Custom4.getAttributeValue("color");
2025
				String strFace_Custom4 = elStyle_Custom4.getAttributeValue("face");
2026
				String strFont_Custom4 = elStyle_Custom4.getAttributeValue("font");
2027
				String strSize_Custom4 = elStyle_Custom4.getAttributeValue("size");
2028
			}
2029

    
2030
			childName = "custom5";
2031
			obligatory = false;
2032
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
2033
			success &= doubleResult.getSecondResult();
2034
			Element elCustom5 = doubleResult.getFirstResult();
2035
			if (elCustom5 != null) {
2036

    
2037
				childName = "style";
2038
				obligatory = false;
2039
				doubleResult =  XmlHelp.getSingleChildElement(elCustom5, childName, tcsNamespace, obligatory);
2040
				success &= doubleResult.getSecondResult();
2041
				Element elStyle_Custom5 = doubleResult.getFirstResult();
2042
				String strColor_Custom5 = elStyle_Custom5.getAttributeValue("color");
2043
				String strFace_Custom5 = elStyle_Custom5.getAttributeValue("face");
2044
				String strFont_Custom5 = elStyle_Custom5.getAttributeValue("font");
2045
				String strSize_Custom5 = elStyle_Custom5.getAttributeValue("size");
2046
			}
2047

    
2048
			childName = "custom6";
2049
			obligatory = false;
2050
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
2051
			success &= doubleResult.getSecondResult();
2052
			Element elCustom6 = doubleResult.getFirstResult();
2053
			if (elCustom6 != null) {
2054

    
2055
				childName = "style";
2056
				obligatory = false;
2057
				doubleResult =  XmlHelp.getSingleChildElement(elCustom6, childName, tcsNamespace, obligatory);
2058
				success &= doubleResult.getSecondResult();
2059
				Element elStyle_Custom6 = doubleResult.getFirstResult();
2060
				String strColor_Custom6 = elStyle_Custom6.getAttributeValue("color");
2061
				String strFace_Custom6 = elStyle_Custom6.getAttributeValue("face");
2062
				String strFont_Custom6 = elStyle_Custom6.getAttributeValue("font");
2063
				String strSize_Custom6 = elStyle_Custom6.getAttributeValue("size");
2064
			}
2065

    
2066
			childName = "custom7";
2067
			obligatory = false;
2068
			doubleResult =  XmlHelp.getSingleChildElement(elRecord, childName, tcsNamespace, obligatory);
2069
			success &= doubleResult.getSecondResult();
2070
			Element elCustom7 = doubleResult.getFirstResult();
2071
			if (elCustom7 != null) {
2072

    
2073
				childName = "style";
2074
				obligatory = false;
2075
				doubleResult =  XmlHelp.getSingleChildElement(elCustom7, childName, tcsNamespace, obligatory);
2076
				success &= doubleResult.getSecondResult();
2077
				Element elStyle_Custom7 = doubleResult.getFirstResult();
2078
				String strColor_Custom7 = elStyle_Custom7.getAttributeValue("color");
2079
				String strFace_Custom7 = elStyle_Custom7.getAttributeValue("face");
2080
				String strFont_Custom7 = elStyle_Custom7.getAttributeValue("font");
2081
				String strSize_Custom7 = elStyle_Custom7.getAttributeValue("size");
2082
			}
2083
		 */
2084
			authorMap.put(elRec_number, (Team) author);
2085
			referenceMap.put(elRec_number, reference);
2086
		}
2087

    
2088
		logger.info(i + " Records handled. Saving ...");
2089
		referenceService.save(referenceMap.objects());
2090
		logger.info("end make Records ...");
2091
		if (!success){
2092
			state.setUnsuccessfull();
2093
		}
2094
		return;
2095
	}
2096

    
2097
	@Override
2098
    protected boolean isIgnore(EndnoteImportState state){
2099
		return false;
2100
	}
2101
}
(4-4/5)