Project

General

Profile

« Previous | Next » 

Revision 538c276e

Added by Andreas Müller over 7 years ago

merge app-import 3.4 branch into trunk

View differences:

XperCdmIntegration/pom.xml
7 7
  <parent>
8 8
    <groupId>eu.etaxonomy</groupId>
9 9
    <artifactId>cdmlib-parent</artifactId>
10
    <version>3.2.4-SNAPSHOT</version>
10
    <version>3.4.0-SNAPSHOT</version>
11 11
    <relativePath>../pom.xml</relativePath>
12 12
  </parent>
13 13
  
app-import/pom.xml
8 8
  
9 9
  <groupId>eu.etaxonomy.cdm</groupId>
10 10
  <artifactId>imports</artifactId>
11
  <version>3.3.8-SNAPSHOT</version>
11
  <version>3.4.0-SNAPSHOT</version>
12 12
  
13 13
  <name>App Import</name>
14 14
  <description>A collection of diverse imports to the EDIT CDM Platform</description>
app-import/src/main/java/eu/etaxonomy/cdm/app/proibiosphere/SynthesysCacheActivator.java
80 80
            p.setFirstname("Quentin");
81 81
            p.setLastname("Groom");
82 82
            p.addEmailAddress("qgroom@bsbi.co.uk");
83
            reference.setAuthorTeam(p);
83
            reference.setAuthorship(p);
84 84
            reference.setOrganization("Botanical Society of the British Isles");
85 85

  
86 86
            specimenImportConfigurator.setSourceReference(reference);
app-import/src/main/java/eu/etaxonomy/cdm/app/util/TestDatabase.java
89 89
		DataSet dataSet = buildDataSet();
90 90
		
91 91
		appCtr.getTermService().save(dataSet.getTerms());
92
		appCtr.getTaxonService().save(dataSet.getTaxonBases());
92
		appCtr.getTaxonService().save((List)dataSet.getTaxonBases());
93 93

  
94 94
		appCtr.commitTransaction(txStatus);
95 95
		appCtr.close();
......
230 230
		
231 231
        // references
232 232
		sec = ReferenceFactory.newBook();
233
		sec.setAuthorTeam(linne);
233
		sec.setAuthorship(linne);
234 234
		sec.setTitleCache("Plant Specification & Taxonomy", true);
235 235
		references.add(sec);
236 236
		
237 237
		citRef = ReferenceFactory.newDatabase();
238
		citRef.setAuthorTeam(linne);
238
		citRef.setAuthorship(linne);
239 239
		citRef.setTitleCache("BioCASE", true);
240 240
		references.add(citRef);
241 241

  
......
340 340
//		dataSet.setAgentData(agentData); //TODO
341 341
		dataSet.setReferences(references);
342 342
		dataSet.setTaxonomicNames(taxonomicNames);
343
		dataSet.setTaxonBases(taxonBases);
343
		dataSet.setTaxonBases((List)taxonBases);
344 344
		
345 345
		
346 346
		return dataSet;
app-import/src/main/java/eu/etaxonomy/cdm/app/wp6/palmae/UseImport.java
180 180
				Reference citation = ReferenceFactory.newGeneric();
181 181
				Team authorTeam = Team.NewInstance();
182 182
				authorTeam.setTitleCache(lstUpdate.get(3));
183
				citation.setAuthorTeam(authorTeam);
183
				citation.setAuthorship(authorTeam);
184 184
				citation.setTitle(lstUpdate.get(4));
185 185
				
186 186
				//citation.
app-import/src/main/java/eu/etaxonomy/cdm/io/berlinModel/in/BerlinModelReferenceImport.java
522 522
		}
523 523

  
524 524
		//author
525
		TeamOrPersonBase<?> author = getAuthorTeam(refAuthorString , nomAuthor);
526
		ref.setAuthorTeam(author);
525
		TeamOrPersonBase<?> author = getAuthorship(refAuthorString , nomAuthor);
526
		ref.setAuthorship(author);
527 527
		
528 528
		//save
529 529
		if (! refToSave.containsKey(refId)){
......
843 843
	}
844 844

  
845 845
	
846
	private static TeamOrPersonBase<?> getAuthorTeam(String authorString, TeamOrPersonBase<?> nomAuthor){
846
	private static TeamOrPersonBase<?> getAuthorship(String authorString, TeamOrPersonBase<?> nomAuthor){
847 847
		TeamOrPersonBase<?> result;
848 848
		if (nomAuthor != null){
849 849
			result = nomAuthor;
app-import/src/main/java/eu/etaxonomy/cdm/io/berlinModel/in/BerlinModelTaxonImport.java
241 241
						}
242 242
						
243 243
						if ( ! misapplied){
244
//							logger.error("Publish Flag for synonyms not yet handled correctly");
245
//							taxonBase.setPublish(publishFlag);
244
							taxonBase.setPublish(publishFlag);
246 245
							if(taxonBase.isInstanceOf(Taxon.class) ){
247 246
								CdmBase.deproxy(taxonBase, Taxon.class).setPublish(publishFlag);
248 247
							}
app-import/src/main/java/eu/etaxonomy/cdm/io/berlinModel/in/validation/BerlinModelAuthorTeamImportValidator.java
26 26
	@Override
27 27
	public boolean validate(BerlinModelImportState state) {
28 28
		boolean result = true;
29
		System.out.println("Checking for authorteams not yet implemented");
29
		System.out.println("Checking for authors not yet implemented");
30 30
		//result &= checkArticlesWithoutJournal(bmiConfig);
31 31
		//result &= checkPartOfJournal(bmiConfig);
32 32
		
app-import/src/main/java/eu/etaxonomy/cdm/io/berlinModel/out/BerlinModelReferenceExport.java
83 83
		mapping.addMapper(MethodMapper.NewInstance("NomRefCache", this));
84 84
		mapping.addMapper(DbBooleanMapper.NewFalseInstance("isProtectedTitleCache","PreliminaryFlag"));
85 85

  
86
		mapping.addMapper(DbObjectMapper.NewInstance("authorTeam", "NomAuthorTeamFk"));
86
		mapping.addMapper(DbObjectMapper.NewInstance("authorship", "NomAuthorTeamFk"));
87 87
		mapping.addMapper(MethodMapper.NewInstance("RefAuthorString", this));
88 88
		
89 89
		mapping.addMapper(DbStringMapper.NewInstance("title", "Title"));
......
288 288
		if (ref == null){
289 289
			return null;
290 290
		}else{
291
			return (ref.getAuthorTeam() == null)? null: ref.getAuthorTeam().getTitleCache();
291
			return (ref.getAuthorship() == null)? null: ref.getAuthorship().getTitleCache();
292 292
		}
293 293
	}
294 294

  
app-import/src/main/java/eu/etaxonomy/cdm/io/caryo/CaryoTaxonImport.java
339 339
				IBookSection section = ReferenceFactory.newBookSection();
340 340
				section.setInBook(book);
341 341
				TeamOrPersonBase<?> inAuthor = getInAuthor(inAutorStr);
342
				book.setAuthorTeam(inAuthor);
342
				book.setAuthorship(inAuthor);
343 343
				result = section;
344 344
			}else{
345 345
				result = book;
......
349 349
			result = null;
350 350
		}
351 351
		if (result != null){
352
			result.setAuthorTeam(author);
352
			result.setAuthorship(author);
353 353
			makeDate(state, rs, result, id);
354 354
		}
355 355
		return result;
app-import/src/main/java/eu/etaxonomy/cdm/io/globis/GlobisCommonNameImport.java
208 208
					author = makeSingleAuthor(authors);
209 209
				}
210 210
				
211
				result.setAuthorTeam(author);
211
				result.setAuthorship(author);
212 212
				refMap.put(refId,result);
213 213
				rs.close();
214 214
			} catch (SQLException e) {
app-import/src/main/java/eu/etaxonomy/cdm/io/globis/GlobisReferenceImport.java
169 169
			
170 170
			//refAuthor
171 171
			TeamOrPersonBase<?> author = makeAuthor(refAuthor, state);
172
			ref.setAuthorTeam(author);
172
			ref.setAuthorship(author);
173 173
			
174 174
			//inRef
175 175
			if (isNotBlank(refJournal)){
cdm-eflora/pom.xml
9 9
  
10 10
  <groupId>eu.etaxonomy.cdm</groupId>
11 11
  <artifactId>cdm-eflora</artifactId>
12
  <version>3.3.8-SNAPSHOT</version>
12
  <version>3.4.0-SNAPSHOT</version>
13 13
  
14 14
  <name>CDM e-Flora</name>
15 15
  <description>The e-Flora package for e-FLora imports to the EDIT CDM Platform</description>
cdm-eflora/src/main/java/eu/etaxonomy/cdm/io/eflora/EfloraTaxonImport.java
1370 1370
		if (team == null){
1371 1371
			team = lastTeam;
1372 1372
		}
1373
		ref.setAuthorTeam(team);
1373
		ref.setAuthorship(team);
1374 1374
		
1375 1375
		TaxonDescription description = getDescription(taxon);
1376 1376
		TextData textData = TextData.NewInstance(Feature.CITATION());
......
1431 1431
				logger.error("ERROR occurred when trying to split title: " +  title + "; split[0]: + " + split[0]);
1432 1432
			}
1433 1433
			book.setTitle(title);
1434
			book.setAuthorTeam(bookTeam);
1434
			book.setAuthorship(bookTeam);
1435 1435
			book.setDatePublished(ref.getDatePublished());
1436 1436
			ref.setTitle(null);
1437 1437
			ref.setInBook(book);
......
1526 1526
			homonymName.setNomenclaturalMicroReference(homonymNomRefDetail);
1527 1527
			String authorTitle = homonymNomRef.getTitleCache();
1528 1528
			Team team = Team.NewTitledInstance(authorTitle, authorTitle);
1529
			homonymNomRef.setAuthorTeam(team);
1529
			homonymNomRef.setAuthorship(team);
1530 1530
			homonymNomRef.setTitle("");
1531 1531
			homonymNomRef.setProtectedTitleCache(false);
1532 1532
			
......
1570 1570
		if (team == null){
1571 1571
			logger.warn("Name has nom. ref. but no author team. Name: " + name.getTitleCache() + ", Nom.Ref.: " + value);
1572 1572
		}else{
1573
			nomRef.setAuthorTeam(team);
1573
			nomRef.setAuthorship(team);
1574 1574
		}
1575 1575
		return team;
1576 1576
	}
cdm-eflora/src/main/java/eu/etaxonomy/cdm/io/eflora/centralAfrica/ericaceae/CentralAfricaEricaceaeTaxonImport.java
69 69
		name.setNomenclaturalMicroReference(microReference);
70 70
		
71 71
		TeamOrPersonBase  nameTeam = CdmBase.deproxy(name.getCombinationAuthorTeam(), TeamOrPersonBase.class);
72
		TeamOrPersonBase  refTeam = nomRef.getAuthorTeam();
72
		TeamOrPersonBase  refTeam = nomRef.getAuthorship();
73 73
		if (nameTeam == null ){
74 74
			logger.warn("Name has nom. ref. but no author team. Name: " + name.getTitleCache() + ", Nom.Ref.: " + value);
75 75
		}else if (refTeam == null ){
......
77 77
		}else if (! authorTeamsMatch(refTeam, nameTeam)){
78 78
			logger.warn("Nom.Ref. author and comb. author do not match: " + nomRef.getTitleCache() + " <-> " + nameTeam.getNomenclaturalTitle());
79 79
		}else {
80
			nomRef.setAuthorTeam(nameTeam);
80
			nomRef.setAuthorship(nameTeam);
81 81
			nomRef.setTitle(CdmUtils.Nz(nomRef.getTitle()) + " - no title given yet -");
82 82
			nameTeam.setTitleCache(refTeam.getTitleCache(), true);
83 83
		}
......
117 117
			String author = titleToParse.substring(0, start).trim();
118 118
			author = parseInRefrence(ref, author);
119 119
			TeamOrPersonBase team = parseSingleTeam(author);
120
			ref.setAuthorTeam(team);
120
			ref.setAuthorship(team);
121 121
			ref.setProtectedTitleCache(false);
122 122
		}else{
123 123
			logger.warn("Could not parse reference: " +  titleToParse);
......
133 133
			String myAuthorString = author.substring(0, pos);
134 134
			Reference inReference = ReferenceFactory.newGeneric();
135 135
			TeamOrPersonBase inAuthor = parseSingleTeam(inAuthorString);
136
			inReference.setAuthorTeam(inAuthor);
136
			inReference.setAuthorship(inAuthor);
137 137
			ref.setInReference(inReference);
138 138
			return myAuthorString;
139 139
		}else{
......
173 173
		ref.setTitleCache(referenceTitle, true);
174 174
		
175 175
		TeamOrPersonBase<?> team = getReferenceAuthor(ref, name);
176
		ref.setAuthorTeam(team);
176
		ref.setAuthorship(team);
177 177
	
178 178
		String[] multipleReferences = ref.getTitleCache().split("&");
179 179
		
......
181 181
		for (String singleReferenceString : multipleReferences){
182 182
			Reference<?> singleRef = ReferenceFactory.newGeneric();
183 183
			singleRef.setTitleCache(singleReferenceString.trim(), true);
184
			singleRef.setAuthorTeam(team);
184
			singleRef.setAuthorship(team);
185 185
			
186 186
			String microReference = parseReferenceYearAndDetailForUsage(singleRef);
187 187
			
cdm-eflora/src/main/java/eu/etaxonomy/cdm/io/eflora/centralAfrica/ferns/CentralAfricaFernsTaxonImport.java
576 576
			bracket = bracket.substring(0, bracket.length()-1);
577 577
		}
578 578
		Team team = Team.NewTitledInstance(authorPart, authorPart);
579
		result.setAuthorTeam(team);
579
		result.setAuthorship(team);
580 580
		String[] bracketSplit = bracket.split(":");
581 581
		TimePeriod datePublished = TimePeriodParser.parseString(bracketSplit[0].trim());
582 582
		result.setDatePublished(datePublished);
......
648 648
					StringUtils.isNotBlank(datePublishedString) || StringUtils.isNotBlank(paperTitle)){
649 649
			NonViralName<?> name = CdmBase.deproxy(taxonBase.getName(), NonViralName.class);
650 650
			Reference<?> reference = ReferenceFactory.newGeneric();
651
			reference.setAuthorTeam((TeamOrPersonBase<?>)name.getCombinationAuthorTeam());
651
			reference.setAuthorship((TeamOrPersonBase<?>)name.getCombinationAuthorTeam());
652 652
			reference.setTitle(referenceString);
653 653
			reference.setVolume(volume);
654 654
			reference.setEdition(part);
cdm-pesi/pom.xml
13 13
  
14 14
  <groupId>eu.etaxonomy.cdm</groupId>
15 15
  <artifactId>cdm-pesi</artifactId>
16
  <version>3.3.8-SNAPSHOT</version>
16
  <version>3.4.0-SNAPSHOT</version>
17 17
  
18 18
  <name>CDM PESI</name>
19 19
  <description>The PESI package for EDIT's CdmLibrary</description>
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/common/TestDatabase.java
90 90
		DataSet dataSet = buildDataSet();
91 91
		
92 92
		appCtr.getTermService().save(dataSet.getTerms());
93
		appCtr.getTaxonService().save(dataSet.getTaxonBases());
93
		appCtr.getTaxonService().save((List)dataSet.getTaxonBases());
94 94

  
95 95
		appCtr.commitTransaction(txStatus);
96 96
		appCtr.close();
......
231 231
		
232 232
        // references
233 233
		sec = ReferenceFactory.newBook();
234
		sec.setAuthorTeam(linne);
234
		sec.setAuthorship(linne);
235 235
		sec.setTitleCache("Plant Specification & Taxonomy", true);
236 236
		references.add(sec);
237 237
		
238 238
		citRef = ReferenceFactory.newDatabase();
239
		citRef.setAuthorTeam(linne);
239
		citRef.setAuthorship(linne);
240 240
		citRef.setTitleCache("BioCASE", true);
241 241
		references.add(citRef);
242 242

  
......
341 341
//		dataSet.setAgentData(agentData); //TODO
342 342
		dataSet.setReferences(references);
343 343
		dataSet.setTaxonomicNames(taxonomicNames);
344
		dataSet.setTaxonBases(taxonBases);
344
		dataSet.setTaxonBases((List)taxonBases);
345 345
		
346 346
		
347 347
		return dataSet;
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/faunaEuropaea/FaunaEuropaeaRefImport.java
240 240
					}
241 241
				}
242 242
				
243
				reference.setAuthorTeam(author);
243
				reference.setAuthorship(author);
244 244
				
245 245
				ImportHelper.setOriginalSource(reference, fauEuConfig.getSourceReference(), refId, namespace);
246 246
				ImportHelper.setOriginalSource(author, fauEuConfig.getSourceReference(), refId, namespace);
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/faunaEuropaea/FaunaEuropaeaUsersImport.java
199 199
				}
200 200
				reference.setTitleCache(referenceTitleCache.toString(), true);
201 201
				
202
				reference.setAuthorTeam((TeamOrPersonBase)person);
202
				reference.setAuthorship((TeamOrPersonBase)person);
203 203
				
204 204
				//ImportHelper.setOriginalSource(user, fauEuConfig.getSourceReference(), userId, namespace);
205 205
				ImportHelper.setOriginalSource(person, fauEuConfig.getSourceReference(), refId, namespace);
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/indexFungorum/IndexFungorumImportBase.java
304 304
		//inRef + inRefAuthor
305 305
		if (pubAuthor != null){
306 306
			Reference<?> inRef = ReferenceFactory.newGeneric();
307
			inRef.setAuthorTeam(pubAuthor);
307
			inRef.setAuthorship(pubAuthor);
308 308
			ref.setInReference(inRef);
309 309
			hasInReference = true;
310 310
		}
......
314 314
		if (refAuthor == null){
315 315
			refAuthor = Team.NewTitledInstance(authorStr, authorStr);
316 316
		}
317
		ref.setAuthorTeam(refAuthor);
317
		ref.setAuthorship(refAuthor);
318 318
		//location
319 319
		String location = rs.getString("pubIMIAbbrLoc");
320 320
		if (StringUtils.isNotBlank(location)){
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/out/PesiSourceExport.java
265 265

  
266 266
		try {
267 267
		if (reference != null) {
268
			TeamOrPersonBase team = reference.getAuthorTeam();
268
			TeamOrPersonBase team = reference.getAuthorship();
269 269
			if (team != null) {
270 270
				result = team.getTitleCache();
271 271
//				result = team.getNomenclaturalTitle();
cdmapps-parent/pom.xml
3 3
    <modelVersion>4.0.0</modelVersion>
4 4
    <groupId>eu.etaxonomy.cdm</groupId>
5 5
    <artifactId>app-parent</artifactId>
6
	<version>3.2.0-SNAPSHOT</version>
6
	<version>3.4.0-SNAPSHOT</version>
7 7
    <name>CDM Applications Parent</name>
8 8
    <description>The Java implementation of the Common Data Model (CDM), the data model for EDIT's internet platform for cybertaxonomy.</description>
9 9
    <url>http://wp5.e-taxonomy.eu/cdmlib/</url>
pom.xml
4 4
	<parent>
5 5
		<groupId>eu.etaxonomy</groupId>
6 6
		<artifactId>cdmlib-parent</artifactId>
7
		<version>3.3.8-SNAPSHOT</version>
7
		<version>3.4.0-SNAPSHOT</version>
8 8
		<relativePath>../pom.xml</relativePath>
9 9
	</parent>
10 10

  
11 11
	<modelVersion>4.0.0</modelVersion>
12
	<artifactId>cdmlib-io</artifactId>
13
	<name>CDM Import/Export</name>
14
	<description>The import-export package for EDIT's cdmLibrary</description>
12
	<artifactId>cdmlib-app</artifactId>
13
	<name>CDM Parent</name>
14
	<description>The parent package for EDIT's cdmLibrary</description>
15 15
	<scm>
16 16
		<connection>scm:svn:http://dev.e-taxonomy.eu/svn/trunk/cdmlib/cdmlib-io/</connection>
17 17
		<developerConnection>scm:svn:http://dev.e-taxonomy.eu/svn/trunk/cdmlib/cdmlib-io/</developerConnection>

Also available in: Unified diff