bd7d5029812daca9c75e125eec469e1c7de98f49
[cdmlib.git] / cdmlibrary / src / main / java / eu / etaxonomy / cdm / model / reference / ReferenceBase.java
1 /**
2 * Copyright (C) 2007 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 package eu.etaxonomy.cdm.model.reference;
11
12
13 import eu.etaxonomy.cdm.model.agent.Agent;
14 import eu.etaxonomy.cdm.model.agent.Team;
15 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
16 import org.apache.log4j.Logger;
17 import org.hibernate.annotations.Cascade;
18 import org.hibernate.annotations.CascadeType;
19
20 import java.util.*;
21 import javax.persistence.*;
22
23 /**
24 * A year() method is required to get the year of publication out of the
25 * datePublished field
26 * @author m.doering
27 * @version 1.0
28 * @created 08-Nov-2007 13:06:47
29 */
30 @Entity
31 public abstract class ReferenceBase extends IdentifiableEntity {
32 static Logger logger = Logger.getLogger(ReferenceBase.class);
33 //URIs like DOIs, LSIDs or Handles for this reference
34 private String uri;
35 //flag to subselect only references that could be useful for nomenclatural citations. If a reference is used as a
36 //nomenclatural reference in a name this flag should be automatically set
37 private boolean isNomenclaturallyRelevant;
38 private Agent authorTeam;
39
40
41 @ManyToOne
42 @Cascade({CascadeType.SAVE_UPDATE})
43 public Agent getAuthorTeam(){
44 return this.authorTeam;
45 }
46
47 public void setAuthorTeam(Agent authorTeam){
48 this.authorTeam = authorTeam;
49 }
50
51 public String getUri(){
52 return this.uri;
53 }
54
55 /**
56 *
57 * @param uri uri
58 */
59 public void setUri(String uri){
60 this.uri = uri;
61 }
62
63 public boolean isNomenclaturallyRelevant(){
64 return this.isNomenclaturallyRelevant;
65 }
66
67 /**
68 *
69 * @param isNomenclaturallyRelevant isNomenclaturallyRelevant
70 */
71 public void setNomenclaturallyRelevant(boolean isNomenclaturallyRelevant){
72 this.isNomenclaturallyRelevant = isNomenclaturallyRelevant;
73 }
74
75 /**
76 * returns a formatted string containing the entire reference citation including
77 * authors
78 */
79 @Transient
80 public String getCitation(){
81 return "";
82 }
83
84 @Transient
85 public abstract String getYear();
86
87 }