1 |
9479da48
|
Andreas Müller
|
/**
|
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 |
835c12dd
|
Andreas Müller
|
import javax.persistence.Entity;
|
14 |
|
|
import javax.persistence.Transient;
|
15 |
|
|
|
16 |
9479da48
|
Andreas Müller
|
import org.apache.log4j.Logger;
|
17 |
788ff862
|
Andreas Müller
|
|
18 |
04c7a71a
|
m.geoffroy
|
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
|
19 |
|
|
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
|
20 |
|
|
import eu.etaxonomy.cdm.model.name.Rank;
|
21 |
788ff862
|
Andreas Müller
|
import eu.etaxonomy.cdm.strategy.cache.reference.GenericDefaultCacheStrategy;
|
22 |
9479da48
|
Andreas Müller
|
|
23 |
|
|
/**
|
24 |
04c7a71a
|
m.geoffroy
|
* This class represents all references which cannot be clearly assigned to a
|
25 |
|
|
* particular {@link StrictReferenceBase reference} subclass. Therefore attributes which are
|
26 |
|
|
* characteristic for a unique reference subclass are not necessary here.
|
27 |
|
|
* <P>
|
28 |
|
|
* This class corresponds, according to the TDWG ontology, to the publication type
|
29 |
|
|
* terms (from PublicationTypeTerm): <ul>
|
30 |
|
|
* <li> "Generic"
|
31 |
|
|
* <li> "Artwork"
|
32 |
|
|
* <li> "AudiovisualMaterial"
|
33 |
|
|
* <li> "ComputerProgram"
|
34 |
|
|
* <li> "Determination"
|
35 |
|
|
* <li> "Commentary"
|
36 |
|
|
* <li> "SubReference"
|
37 |
|
|
* </ul>
|
38 |
|
|
*
|
39 |
9479da48
|
Andreas Müller
|
* @author m.doering
|
40 |
|
|
* @version 1.0
|
41 |
|
|
* @created 08-Nov-2007 13:06:26
|
42 |
|
|
*/
|
43 |
|
|
@Entity
|
44 |
835c12dd
|
Andreas Müller
|
public class Generic extends StrictReferenceBase implements INomenclaturalReference, Cloneable {
|
45 |
9479da48
|
Andreas Müller
|
static Logger logger = Logger.getLogger(Generic.class);
|
46 |
|
|
private String publisher;
|
47 |
|
|
private String placePublished;
|
48 |
|
|
private String editor;
|
49 |
|
|
private String series;
|
50 |
|
|
private String volume;
|
51 |
|
|
private String pages;
|
52 |
788ff862
|
Andreas Müller
|
private NomenclaturalReferenceHelper nomRefBase = NomenclaturalReferenceHelper.NewInstance(this);
|
53 |
9479da48
|
Andreas Müller
|
|
54 |
788ff862
|
Andreas Müller
|
|
55 |
04c7a71a
|
m.geoffroy
|
/**
|
56 |
|
|
* Class constructor: creates a new empty generic reference instance
|
57 |
|
|
* only containing the {@link strategy.cache.reference.GenericDefaultCacheStrategy default cache strategy}.
|
58 |
|
|
*
|
59 |
|
|
* @see strategy.cache.reference.GenericDefaultCacheStrategy
|
60 |
|
|
*/
|
61 |
81c31b35
|
Andreas Müller
|
public Generic(){
|
62 |
|
|
super();
|
63 |
788ff862
|
Andreas Müller
|
this.cacheStrategy = GenericDefaultCacheStrategy.NewInstance();
|
64 |
81c31b35
|
Andreas Müller
|
}
|
65 |
|
|
|
66 |
|
|
|
67 |
04c7a71a
|
m.geoffroy
|
/**
|
68 |
|
|
* Creates a new empty generic reference instance
|
69 |
|
|
* only containing the {@link eu.etaxonomy.cdm.strategy.cache.reference.GenericDefaultCacheStrategy default cache strategy}.
|
70 |
|
|
*
|
71 |
|
|
* @see #Generic()
|
72 |
|
|
* @see eu.etaxonomy.cdm.strategy.cache.reference.GenericDefaultCacheStrategy
|
73 |
|
|
*/
|
74 |
|
|
public static Generic NewInstance(){
|
75 |
|
|
return new Generic();
|
76 |
|
|
}
|
77 |
|
|
|
78 |
|
|
/**
|
79 |
|
|
* Returns the string representing the name of the publisher of <i>this</i>
|
80 |
|
|
* generic reference. A publisher is mostly an institution or a private
|
81 |
|
|
* company which assumed the global responsibility for the publication
|
82 |
|
|
* process.<BR>
|
83 |
|
|
* If there is a publisher then the generic reference must be some kind of
|
84 |
|
|
* {@link PublicationBase publication}.
|
85 |
|
|
*
|
86 |
|
|
* @return the string identifying the publisher of <i>this</i>
|
87 |
|
|
* generic reference
|
88 |
|
|
* @see #getEditor()
|
89 |
|
|
*/
|
90 |
9479da48
|
Andreas Müller
|
public String getPublisher(){
|
91 |
|
|
return this.publisher;
|
92 |
|
|
}
|
93 |
|
|
|
94 |
|
|
/**
|
95 |
04c7a71a
|
m.geoffroy
|
* @see #getPublisher()
|
96 |
9479da48
|
Andreas Müller
|
*/
|
97 |
|
|
public void setPublisher(String publisher){
|
98 |
|
|
this.publisher = publisher;
|
99 |
|
|
}
|
100 |
|
|
|
101 |
04c7a71a
|
m.geoffroy
|
/**
|
102 |
|
|
* Returns the string representing the name of the place (mostly the city)
|
103 |
|
|
* where <i>this</i> generic reference has been published.<BR>
|
104 |
|
|
* If there is a published place then the generic reference must be some
|
105 |
|
|
* kind of {@link PublicationBase publication}.
|
106 |
|
|
*
|
107 |
|
|
* @return the string identifying the publication place of <i>this</i>
|
108 |
|
|
* generic reference
|
109 |
|
|
*/
|
110 |
9479da48
|
Andreas Müller
|
public String getPlacePublished(){
|
111 |
|
|
return this.placePublished;
|
112 |
|
|
}
|
113 |
|
|
|
114 |
|
|
/**
|
115 |
04c7a71a
|
m.geoffroy
|
* @see #getPlacePublished()
|
116 |
9479da48
|
Andreas Müller
|
*/
|
117 |
|
|
public void setPlacePublished(String placePublished){
|
118 |
|
|
this.placePublished = placePublished;
|
119 |
|
|
}
|
120 |
|
|
|
121 |
04c7a71a
|
m.geoffroy
|
/**
|
122 |
|
|
* Returns the string representing the name of the editor of <i>this</i>
|
123 |
|
|
* generic reference. An editor is mostly a person (team) who assumed the
|
124 |
|
|
* responsibility for the content of the publication as a whole without
|
125 |
|
|
* being the author of this content.<BR>
|
126 |
|
|
* If there is an editor then the generic reference must be some
|
127 |
|
|
* kind of {@link PrintedUnitBase physical printed unit}.
|
128 |
|
|
*
|
129 |
|
|
* @return the string identifying the editor of <i>this</i>
|
130 |
|
|
* generic reference
|
131 |
|
|
* @see #getPublisher()
|
132 |
|
|
*/
|
133 |
9479da48
|
Andreas Müller
|
public String getEditor(){
|
134 |
|
|
return this.editor;
|
135 |
|
|
}
|
136 |
|
|
|
137 |
|
|
/**
|
138 |
04c7a71a
|
m.geoffroy
|
* @see #getEditor()
|
139 |
9479da48
|
Andreas Müller
|
*/
|
140 |
|
|
public void setEditor(String editor){
|
141 |
|
|
this.editor = editor;
|
142 |
|
|
}
|
143 |
|
|
|
144 |
04c7a71a
|
m.geoffroy
|
/**
|
145 |
|
|
* Returns the string representing the series (for instance for books or
|
146 |
d3c58152
|
m.geoffroy
|
* within journals) - and series part - in which <i>this</i> generic reference
|
147 |
|
|
* was published.<BR>
|
148 |
04c7a71a
|
m.geoffroy
|
* If there is a series then the generic reference must be some
|
149 |
|
|
* kind of {@link PrintedUnitBase physical printed unit} or an {@link Article article}.
|
150 |
|
|
*
|
151 |
|
|
* @return the string identifying the series for <i>this</i>
|
152 |
|
|
* generic reference
|
153 |
|
|
*/
|
154 |
9479da48
|
Andreas Müller
|
public String getSeries(){
|
155 |
|
|
return this.series;
|
156 |
|
|
}
|
157 |
|
|
|
158 |
|
|
/**
|
159 |
04c7a71a
|
m.geoffroy
|
* @see #getSeries()
|
160 |
9479da48
|
Andreas Müller
|
*/
|
161 |
|
|
public void setSeries(String series){
|
162 |
|
|
this.series = series;
|
163 |
|
|
}
|
164 |
|
|
|
165 |
04c7a71a
|
m.geoffroy
|
/**
|
166 |
|
|
* Returns the string representing the volume (for instance for books or
|
167 |
|
|
* within journals) in which <i>this</i> generic reference was published.<BR>
|
168 |
|
|
* If there is a volume then the generic reference must be some
|
169 |
|
|
* kind of {@link PrintedUnitBase physical printed unit} or an {@link Article article}.
|
170 |
|
|
*
|
171 |
|
|
* @return the string identifying the volume for <i>this</i>
|
172 |
|
|
* generic reference
|
173 |
|
|
*/
|
174 |
9479da48
|
Andreas Müller
|
public String getVolume(){
|
175 |
|
|
return this.volume;
|
176 |
|
|
}
|
177 |
|
|
|
178 |
|
|
/**
|
179 |
04c7a71a
|
m.geoffroy
|
* @see #getVolume()
|
180 |
9479da48
|
Andreas Müller
|
*/
|
181 |
|
|
public void setVolume(String volume){
|
182 |
|
|
this.volume = volume;
|
183 |
|
|
}
|
184 |
|
|
|
185 |
04c7a71a
|
m.geoffroy
|
/**
|
186 |
|
|
* Returns the string representing the page(s) where the content of
|
187 |
|
|
* <i>this</i> generic reference is located.<BR>
|
188 |
|
|
* If there is a pages information then the generic reference must be some
|
189 |
|
|
* kind of {@link PrintedUnitBase physical printed unit} or an {@link Article article}.
|
190 |
|
|
*
|
191 |
|
|
* @return the string containing the pages corresponding to <i>this</i>
|
192 |
|
|
* generic reference
|
193 |
|
|
*/
|
194 |
9479da48
|
Andreas Müller
|
public String getPages(){
|
195 |
|
|
return this.pages;
|
196 |
|
|
}
|
197 |
|
|
|
198 |
|
|
/**
|
199 |
04c7a71a
|
m.geoffroy
|
* @see #getPages()
|
200 |
9479da48
|
Andreas Müller
|
*/
|
201 |
|
|
public void setPages(String pages){
|
202 |
|
|
this.pages = pages;
|
203 |
|
|
}
|
204 |
|
|
|
205 |
04c7a71a
|
m.geoffroy
|
/**
|
206 |
|
|
* Returns a formatted string containing the entire reference citation,
|
207 |
7ba2b731
|
m.geoffroy
|
* including authors, corresponding to <i>this</i> generic reference.<BR>
|
208 |
|
|
* This method overrides the generic and inherited
|
209 |
|
|
* StrictReferenceBase#getCitation() method.
|
210 |
04c7a71a
|
m.geoffroy
|
*
|
211 |
|
|
* @see NomenclaturalReferenceHelper#getCitation()
|
212 |
7ba2b731
|
m.geoffroy
|
* @see StrictReferenceBase#getCitation()
|
213 |
9479da48
|
Andreas Müller
|
*/
|
214 |
|
|
@Transient
|
215 |
|
|
public String getCitation(){
|
216 |
788ff862
|
Andreas Müller
|
return nomRefBase.getCitation();
|
217 |
9479da48
|
Andreas Müller
|
}
|
218 |
|
|
|
219 |
04c7a71a
|
m.geoffroy
|
/**
|
220 |
|
|
* Returns a formatted string containing the entire citation used for
|
221 |
|
|
* nomenclatural purposes based on <i>this</i> generic reference - including
|
222 |
7ba2b731
|
m.geoffroy
|
* (abbreviated) title but not authors - and on the given
|
223 |
04c7a71a
|
m.geoffroy
|
* details.
|
224 |
|
|
*
|
225 |
|
|
* @param microReference the string with the details (generally pages)
|
226 |
1cfec1e9
|
m.geoffroy
|
* within <i>this</i> generic reference
|
227 |
04c7a71a
|
m.geoffroy
|
* @return the formatted string representing the
|
228 |
|
|
* nomenclatural citation
|
229 |
|
|
* @see NomenclaturalReferenceHelper#getNomenclaturalCitation(String)
|
230 |
7ba2b731
|
m.geoffroy
|
* @see INomenclaturalReference#getNomenclaturalCitation(String)
|
231 |
9479da48
|
Andreas Müller
|
*/
|
232 |
|
|
@Transient
|
233 |
bef42c31
|
Andreas Müller
|
public String getNomenclaturalCitation(String microReference) {
|
234 |
788ff862
|
Andreas Müller
|
return nomRefBase.getNomenclaturalCitation(microReference);
|
235 |
9479da48
|
Andreas Müller
|
}
|
236 |
|
|
|
237 |
788ff862
|
Andreas Müller
|
|
238 |
|
|
/* (non-Javadoc)
|
239 |
|
|
* @see eu.etaxonomy.cdm.model.reference.ReferenceBase#generateTitle()
|
240 |
|
|
*/
|
241 |
04c7a71a
|
m.geoffroy
|
/**
|
242 |
|
|
* Generates, according to the {@link strategy.cache.reference.GenericDefaultCacheStrategy default cache strategy}
|
243 |
|
|
* assigned to <i>this</i> generic reference, a string that identifies <i>this</i>
|
244 |
|
|
* reference and returns it. This string may be stored in the inherited
|
245 |
|
|
* {@link common.IdentifiableEntity#getTitleCache() titleCache} attribute.<BR>
|
246 |
|
|
* This method overrides the generic and inherited
|
247 |
|
|
* ReferenceBase#generateTitle() method.
|
248 |
|
|
*
|
249 |
|
|
* @return the string identifying <i>this</i> generic reference
|
250 |
|
|
* @see #getCitation()
|
251 |
|
|
* @see NomenclaturalReferenceHelper#generateTitle()
|
252 |
|
|
* @see common.IdentifiableEntity#getTitleCache()
|
253 |
|
|
* @see common.IdentifiableEntity#generateTitle()
|
254 |
|
|
*/
|
255 |
9479da48
|
Andreas Müller
|
@Override
|
256 |
|
|
public String generateTitle(){
|
257 |
788ff862
|
Andreas Müller
|
return nomRefBase.generateTitle();
|
258 |
bef42c31
|
Andreas Müller
|
}
|
259 |
835c12dd
|
Andreas Müller
|
|
260 |
|
|
//*********** CLONE **********************************/
|
261 |
|
|
|
262 |
|
|
|
263 |
04c7a71a
|
m.geoffroy
|
/**
|
264 |
|
|
* Clones <i>this</i> generic reference. This is a shortcut that enables to
|
265 |
|
|
* create a new instance that differs only slightly from <i>this</i> generic
|
266 |
|
|
* reference by modifying only some of the attributes.<BR>
|
267 |
|
|
* This method overrides the {@link StrictReferenceBase#clone() method} from StrictReferenceBase.
|
268 |
|
|
*
|
269 |
|
|
* @see StrictReferenceBase#clone()
|
270 |
|
|
* @see media.IdentifyableMediaEntity#clone()
|
271 |
|
|
* @see java.lang.Object#clone()
|
272 |
835c12dd
|
Andreas Müller
|
*/
|
273 |
|
|
public Generic clone(){
|
274 |
|
|
Generic result = (Generic)super.clone();
|
275 |
|
|
//no changes to: editor, pages, placePublished,publisher, series, volume
|
276 |
|
|
return result;
|
277 |
|
|
}
|
278 |
9479da48
|
Andreas Müller
|
|
279 |
|
|
}
|