StrictReferenceBase matchable
[cdmlib.git] / cdmlib-model / src / main / java / eu / etaxonomy / cdm / model / reference / BibtexReference.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 javax.persistence.Column;
14 import javax.persistence.Entity;
15 import javax.persistence.FetchType;
16 import javax.persistence.ManyToOne;
17 import javax.persistence.Transient;
18 import javax.xml.bind.annotation.XmlAccessType;
19 import javax.xml.bind.annotation.XmlAccessorType;
20 import javax.xml.bind.annotation.XmlElement;
21 import javax.xml.bind.annotation.XmlIDREF;
22 import javax.xml.bind.annotation.XmlRootElement;
23 import javax.xml.bind.annotation.XmlSchemaType;
24 import javax.xml.bind.annotation.XmlType;
25
26 import org.apache.log4j.Logger;
27 import org.hibernate.envers.Audited;
28 import org.hibernate.search.annotations.Field;
29 import org.hibernate.search.annotations.Index;
30 import org.hibernate.search.annotations.Indexed;
31 import org.springframework.beans.factory.annotation.Configurable;
32
33 import eu.etaxonomy.cdm.model.common.TimePeriod;
34 import eu.etaxonomy.cdm.strategy.cache.reference.BibtexDefaultCacheStrategy;
35 import eu.etaxonomy.cdm.strategy.cache.reference.INomenclaturalReferenceCacheStrategy;
36
37 /**
38 * This class represents references which are structured according to the BibTeX
39 * format. The flat BibTeX format is an usual alternative to handle references
40 * (see <a href="http://en.wikipedia.org/wiki/BibTeX">BibTeX</a>)
41 * Therefore this class might be
42 * used instead of {@link StrictReferenceBase StrictReferenceBase} depending on the data
43 * to be imported in the CDM.
44 *
45 * @see BibtexEntryType
46 * @author m.doering
47 * @version 1.0
48 * @created 08-Nov-2007 13:06:12
49 */
50 @XmlAccessorType(XmlAccessType.FIELD)
51 @XmlType(name = "BibtexReference", propOrder = {
52 "type",
53 "journal",
54 "booktitle",
55 "chapter",
56 "title",
57 "series",
58 "edition",
59 "volume",
60 "number",
61 "pages",
62 "annote",
63 "editor",
64 "institution",
65 "school",
66 "organization",
67 "publisher",
68 "address",
69 "howpublished",
70 "reportType",
71 "month",
72 "year",
73 "eprint",
74 "note",
75 "crossref",
76 "nomRefBase"
77 })
78 @XmlRootElement(name = "BibtexReference")
79 @Entity
80 @Indexed(index = "eu.etaxonomy.cdm.model.reference.ReferenceBase")
81 @Audited
82 @Configurable
83 public class BibtexReference extends ReferenceBase<INomenclaturalReferenceCacheStrategy<BibtexReference>> implements INomenclaturalReference, Cloneable {
84 /**
85 *
86 */
87 private static final long serialVersionUID = 2313713431383650655L;
88
89 private static final Logger logger = Logger.getLogger(BibtexReference.class);
90
91 @XmlElement(name = "BibtexEntryType")
92 @ManyToOne(fetch = FetchType.LAZY)
93 private BibtexEntryType type;
94
95 @XmlElement(name = "Journal")
96 @Field(index=Index.TOKENIZED)
97 private String journal;
98
99 @XmlElement(name = "Booktitle")
100 @Field(index=Index.TOKENIZED)
101 private String booktitle;
102
103 @XmlElement(name = "Chapter")
104 @Field(index=Index.TOKENIZED)
105 private String chapter;
106
107 @XmlElement(name = "Title")
108 @Field(index=Index.TOKENIZED)
109 @Column(name="bibtextitle")
110 private String title;
111
112 @XmlElement(name = "Series")
113 @Field(index=Index.TOKENIZED)
114 private String series;
115
116 @XmlElement(name = "Edition")
117 @Field(index=Index.TOKENIZED)
118 private String edition;
119
120 @XmlElement(name = "Volume")
121 @Field(index=Index.TOKENIZED)
122 private String volume;
123
124 @XmlElement(name = "Number")
125 @Field(index=Index.TOKENIZED)
126 private String number;
127
128 @XmlElement(name = "Pages")
129 @Field(index=Index.TOKENIZED)
130 private String pages;
131
132 @XmlElement(name = "Annote")
133 @Field(index=Index.TOKENIZED)
134 private String annote;
135
136 @XmlElement(name = "Editor")
137 @Field(index=Index.TOKENIZED)
138 private String editor;
139
140 @XmlElement(name = "Institution")
141 @Field(index=Index.TOKENIZED)
142 private String institution;
143
144 @XmlElement(name = "School")
145 @Field(index=Index.TOKENIZED)
146 private String school;
147
148 @XmlElement(name = "Organization")
149 @Field(index=Index.TOKENIZED)
150 private String organization;
151
152 @XmlElement(name = "Publisher")
153 @Field(index=Index.TOKENIZED)
154 private String publisher;
155
156 @XmlElement(name = "Address")
157 @Field(index=Index.TOKENIZED)
158 private String address;
159
160 @XmlElement(name = "HowPublished")
161 @Field(index=Index.TOKENIZED)
162 private String howpublished;
163
164 @XmlElement(name = "ReportType")
165 @Field(index=Index.TOKENIZED)
166 private String reportType;
167
168 @XmlElement(name = "Month")
169 @Field(index=Index.TOKENIZED)
170 private String month;
171
172 @XmlElement(name = "Year")
173 @Field(index=Index.TOKENIZED)
174 private String year;
175
176 @XmlElement(name = "Eprint")
177 @Field(index=Index.TOKENIZED)
178 private String eprint;
179
180 @XmlElement(name = "Note")
181 @Field(index=Index.TOKENIZED)
182 private String note;
183
184 @XmlElement(name = "Crossref")
185 @XmlIDREF
186 @XmlSchemaType(name = "IDREF")
187 @ManyToOne(fetch = FetchType.LAZY)
188 private BibtexReference crossref;
189
190 // @XmlElementRef(name = "NomenclaturalReferenceBase")
191 // @Transient
192 // private NomenclaturalReferenceHelper nomRefBase = NomenclaturalReferenceHelper.NewInstance(this);
193
194
195 /**
196 * Class constructor: creates a new empty BibTeX reference instance only
197 * containing the {@link eu.etaxonomy.cdm.strategy.cache.reference.BibtexDefaultCacheStrategy default cache strategy}.
198 *
199 * @see eu.etaxonomy.cdm.strategy.cache.reference.BibtexDefaultCacheStrategy
200 */
201 protected BibtexReference(){
202 super();
203 this.cacheStrategy = BibtexDefaultCacheStrategy.NewInstance();
204 }
205
206 /**
207 * Creates a new empty BibTeX reference instance only containing the
208 * {@link eu.etaxonomy.cdm.strategy.cache.reference.BibtexDefaultCacheStrategy default cache strategy}.
209 *
210 * @see eu.etaxonomy.cdm.strategy.cache.reference.BibtexDefaultCacheStrategy
211 */
212 public static BibtexReference NewInstance(){
213 BibtexReference result = new BibtexReference();
214 return result;
215 }
216
217 /**
218 * Returns the BibTeX reference <i>this</i> BibTeX reference belongs to (for
219 * instance a BibTeX reference with the {@link BibtexEntryType entry type} "INBOOK" belongs
220 * to another BibTeX reference with the entry type "BOOK").<BR>
221 * The returned "crossref" attribute corresponds to the {@link BookSection#getInBook() "inBook"}
222 * and {@link InProceedings#getInProceedings() "inProceedings"} attributes of {@link BookSection BookSection} and of
223 * {@link InProceedings InProceedings}.
224 *
225 * @return the BibTeX reference containing <i>this</i> BibTeX reference
226 * @see BibtexEntryType
227 */
228 public BibtexReference getCrossref(){
229 return this.crossref;
230 }
231 /**
232 * @see #getCrossref()
233 */
234 public void setCrossref(BibtexReference crossref){
235 this.crossref = crossref;
236 }
237
238 /**
239 * Returns the string representing the journal or magazine title <i>this</i>
240 * BibTeX reference with the {@link BibtexEntryType entry type} "ARTICLE" was
241 * published in.<BR>
242 * The returned "journal" attribute corresponds to the {@link Article#getInJournal() "inJournal"}
243 * attribute of {@link Article Article}.
244 *
245 * @return the string identifying the journal where <i>this</i> BibTeX
246 * reference (article) was published
247 */
248 public String getJournal(){
249 return this.journal;
250 }
251
252 /**
253 * @see #getJournal()
254 */
255 public void setJournal(String journal){
256 this.journal = journal;
257 }
258
259 /**
260 * Returns the string representing the book title <i>this</i>
261 * BibTeX reference, with the {@link BibtexEntryType entry type} "INBOOK", "INCOLLECTION"
262 * "INPROCEEDINGS" or "CONFERENCE", was published in.<BR>
263 * The returned "booktitle" attribute corresponds to the {@link BookSection#getInBook() "inBook"}
264 * attribute of {@link BookSection BookSection}.
265 *
266 * @return the string identifying the book where <i>this</i> BibTeX
267 * reference (part of a book) was published
268 */
269 public String getBooktitle(){
270 return this.booktitle;
271 }
272
273 /**
274 * @see #getBooktitle()
275 */
276 public void setBooktitle(String booktitle){
277 this.booktitle = booktitle;
278 }
279
280 /**
281 * Returns the string representing the chapter number of <i>this</i>
282 * BibTeX reference with the {@link BibtexEntryType entry type} "INBOOK" or "INCOLLECTION"
283 * if this part of a book is a chapter.<BR>
284 * In this case the returned string is included in the inherited {@link BookSection#getTitle() "title"}
285 * attribute of {@link BookSection BookSection}.
286 *
287 * @return the string with the chapter number corresponding to <i>this</i>
288 * BibTeX reference
289 */
290 public String getChapter(){
291 return this.chapter;
292 }
293
294 /**
295 * @see #getChapter()
296 */
297 public void setChapter(String chapter){
298 this.chapter = chapter;
299 }
300
301 /**
302 * Returns the string representing the title of <i>this</i> BibTeX reference.<BR>
303 * The returned "title" attribute corresponds to the {@link StrictReferenceBase#getTitle() "title"}
304 * attribute of {@link StrictReferenceBase StrictReferenceBase}.
305 *
306 * @return the string with the title of <i>this</i> BibTeX reference
307 */
308 public String getTitle(){
309 return this.title;
310 }
311
312 /**
313 * @see #getTitle()
314 */
315 public void setTitle(String title){
316 this.title = title;
317 }
318
319 /**
320 * Returns the string representing the series of books <i>this</i>
321 * BibTeX reference with the {@link BibtexEntryType entry type} "BOOK" or "INBOOK"
322 * was published in.<BR>
323 * The returned "series" attribute corresponds to the inherited {@link PrintedUnitBase#getInSeries() "inSeries"}
324 * attribute of {@link Book Book}.
325 *
326 * @return the string identifying the book series <i>this</i> BibTeX
327 * reference (book) was published in
328 */
329 public String getSeries(){
330 return this.series;
331 }
332
333 /**
334 * @see #getSeries()
335 */
336 public void setSeries(String series){
337 this.series = series;
338 }
339
340 /**
341 * Returns the string representing the edition of <i>this</i>
342 * BibTeX reference with the {@link BibtexEntryType entry type} "BOOK", "INBOOK"
343 * or "MANUAL".<BR>
344 * The returned "edition" attribute corresponds to the {@link Book#getEdition() "edition"}
345 * attribute of {@link Book Book}.
346 *
347 * @return the string identifying the edition of <i>this</i> BibTeX
348 * reference (book)
349 */
350 public String getEdition(){
351 return this.edition;
352 }
353
354 /**
355 * @see #getEdition()
356 */
357 public void setEdition(String edition){
358 this.edition = edition;
359 }
360
361 /**
362 * Returns the string representing either the volume of <i>this</i>
363 * BibTeX reference if it is a {@link BibtexEntryType#BOOK() "BOOK"} or of the journal
364 * in which <i>this</i> BibTeX reference was published if it is an {@link BibtexEntryType#ARTICLE() "ARTICLE"}.<BR>
365 * The returned "volume" attribute corresponds to the "volume" attributes
366 * of {@link PrintedUnitBase#getVolume() PrintedUnitBase} and {@link Article#getVolume() Article}.
367 *
368 * @return the string identifying the volume of <i>this</i> BibTeX
369 * reference (article or book)
370 */
371 public String getVolume(){
372 return this.volume;
373 }
374
375 /**
376 * @see #getVolume()
377 */
378 public void setVolume(String volume){
379 this.volume = volume;
380 }
381
382 /**
383 * Returns the string representing, if applicable, either the number of <i>this</i>
384 * BibTeX reference if it is a {@link BibtexEntryType#TECHREPORT() "TECHREPORT" (report)}
385 * or of the journal in which <i>this</i> BibTeX reference was published if
386 * it is an {@link BibtexEntryType#ARTICLE() "ARTICLE"}. Most publications have a "volume", but no "number".<BR>
387 * In this case the returned string is included in the {@link StrictReferenceBase#getTitle() "title"}
388 * attribute of {@link StrictReferenceBase StrictReferenceBase}.
389 *
390 * @return the string identifying the number for <i>this</i> BibTeX
391 * reference (article or technical report)
392 */
393 public String getNumber(){
394 return this.number;
395 }
396
397 /**
398 * @see #getNumber()
399 */
400 public void setNumber(String number){
401 this.number = number;
402 }
403
404 /**
405 * Returns the string representing the pages range (separated either by
406 * commas or double-hyphens) of <i>this</i> BibTeX reference.
407 *
408 * @return the string with the pages corresponding to <i>this</i> BibTeX
409 * reference
410 */
411 public String getPages(){
412 return this.pages;
413 }
414
415 /**
416 * @see #getPages()
417 */
418 public void setPages(String pages){
419 this.pages = pages;
420 }
421
422 /**
423 * Returns the string representing a (not typical) annotation for annotated
424 * bibliography styles to be applied to <i>this</i> BibTeX reference.
425 *
426 * @return the string with the annotation for annotated bibliography styles
427 */
428 public String getAnnote(){
429 return this.annote;
430 }
431
432 /**
433 * @see #getAnnote()
434 */
435 public void setAnnote(String annote){
436 this.annote = annote;
437 }
438
439 /**
440 * Returns the string representing the name(s) of the editor(s) of <i>this</i>
441 * BibTeX reference.<BR>
442 * The returned "editor" attribute corresponds to the {@link PrintedUnitBase#getEditor() "editor"} attribute
443 * of {@link PrintedUnitBase PrintedUnitBase}.
444 *
445 * @return the string identifying the editor of <i>this</i>
446 * BibTeX reference
447 */
448 public String getEditor(){
449 return this.editor;
450 }
451
452 /**
453 * @see #getEditor()
454 */
455 public void setEditor(String editor){
456 this.editor = editor;
457 }
458
459 /**
460 * Returns the string representing the name of the institution that was
461 * involved in the publishing of <i>this</i> BibTeX reference or the name of
462 * its publisher, if it is a {@link BibtexEntryType#TECHREPORT() "TECHREPORT" (report)}.<BR>
463 * The returned "institution" attribute corresponds to the {@link Report#getInstitution() "institution"}
464 * attribute of {@link Report Report} or to its inherited {@link PublicationBase#getPublisher() "publisher"} attribute.
465 *
466 * @return the string identifying the institution assigned to <i>this</i>
467 * BibTeX reference
468 */
469 public String getInstitution(){
470 return this.institution;
471 }
472
473 /**
474 * @see #getInstitution()
475 */
476 public void setInstitution(String institution){
477 this.institution = institution;
478 }
479
480 /**
481 * Returns the string representing the name of the school where <i>this</i> BibTeX
482 * reference (a {@link BibtexEntryType#MASTERTHESIS() "MASTERTHESIS"} or a
483 * {@link BibtexEntryType#PHDTHESIS() "PHDTHESIS"}) was written.<BR>
484 * The returned "school" attribute corresponds to the {@link Thesis#getSchool() "school"}
485 * attribute of {@link Thesis Thesis}.
486 *
487 * @return the string identifying the school where <i>this</i> BibTeX
488 * reference was written
489 */
490 public String getSchool(){
491 return this.school;
492 }
493
494 /**
495 * @see #getSchool()
496 */
497 public void setSchool(String school){
498 this.school = school;
499 }
500
501 /**
502 * Returns the string representing the name of the organization responsible for the
503 * conference in the context of which <i>this</i> BibTeX reference ({@link BibtexEntryType#PROCEEDINGS() "PROCEEDINGS"},
504 * {@link BibtexEntryType#INPROCEEDINGS() "INPROCEEDINGS"} or a {@link BibtexEntryType#CONFERENCE() "CONFERENCE"})
505 * has been printed.<BR>
506 * The returned "organization" attribute corresponds to the {@link Proceedings#getOrganization() "organization"}
507 * attribute of {@link Proceedings Proceedings}.
508 *
509 * @return the string with the responsible organization of the conference
510 */
511 public String getOrganization(){
512 return this.organization;
513 }
514
515 /**
516 * @see #getOrganization()
517 */
518 public void setOrganization(String organization){
519 this.organization = organization;
520 }
521
522 /**
523 * Returns the string representing the name of the publisher of <i>this</i>
524 * BibTeX reference.<BR>
525 * The returned "publisher" attribute corresponds to the {@link PublicationBase#getPublisher() "publisher"} attribute
526 * of {@link PublicationBase PublicationBase}.
527 *
528 * @return the string identifying the publisher of <i>this</i>
529 * BibTeX reference
530 */
531 public String getPublisher(){
532 return this.publisher;
533 }
534
535 /**
536 * @see #getPublisher()
537 */
538 public void setPublisher(String publisher){
539 this.publisher = publisher;
540 }
541
542 /**
543 * Returns the string representing the address of the publisher of <i>this</i>
544 * BibTeX reference (usually just the city, but can be the full address for
545 * lesser-known publishers).<BR>
546 * The returned "address" attribute corresponds to the {@link PublicationBase#getPlacePublished() "placePublished"} attribute
547 * of {@link PublicationBase PublicationBase}.
548 *
549 * @return the string with the publisher's address
550 */
551 public String getAddress(){
552 return this.address;
553 }
554
555 /**
556 * @see #getAddress()
557 */
558 public void setAddress(String address){
559 this.address = address;
560 }
561
562 /**
563 * Returns the string describing how <i>this</i> BibTeX reference was
564 * published, if the publishing method was nonstandard. This can apply to
565 * the entry types {@link BibtexEntryType#BOOKLET() "BOOKLET"} or {@link BibtexEntryType#MISC() "MISC"}.<BR>
566 * The returned "howpublished" attribute might correspond to one of the
567 * {@link eu.etaxonomy.cdm.model.common.AnnotatableEntity#getAnnotations() annotations}
568 * of {@link PublicationBase PublicationBase}.
569 *
570 * @return the string describing the publishing method
571 */
572 public String getHowpublished(){
573 return this.howpublished;
574 }
575
576 /**
577 * @see #getHowpublished()
578 */
579 public void setHowpublished(String howpublished){
580 this.howpublished = howpublished;
581 }
582
583 /**
584 * Returns the string describing the kind of technical report (for instance
585 * "Research Note") <i>this</i> BibTeX reference ({@link BibtexEntryType#TECHREPORT() "TECHREPORT"}) is.<BR>
586 * The returned "reportType" attribute might correspond to one of the
587 * {@link common.AnnotatableEntity#getAnnotations()() annotations}
588 * of {@link Report Report}.
589 *
590 * @return the string describing the kind of technical report
591 */
592 public String getReportType(){
593 return this.reportType;
594 }
595
596 /**
597 * @see #getReportType()
598 */
599 public void setReportType(String type){
600 this.reportType = type;
601 }
602
603 /**
604 * Returns the string with the month of publication (or, if unpublished,
605 * the month of creation) of <i>this</i> BibTeX reference.<BR>
606 * The returned "month" attribute corresponds partially to the {@link StrictReferenceBase#getDatePublished() "datePublished"}
607 * attribute of {@link StrictReferenceBase StrictReferenceBase}.
608 *
609 * @return the string with the month of publication
610 */
611 public String getMonth(){
612 return this.month;
613 }
614
615 /**
616 * @see #getMonth()
617 */
618 public void setMonth(String month){
619 this.month = month;
620 }
621
622 /**
623 * Returns the string with the year of publication (or, if unpublished,
624 * the year of creation) of <i>this</i> BibTeX reference.<BR>
625 * The returned "year" attribute corresponds partially to the {@link StrictReferenceBase#getDatePublished() "datePublished"}
626 * attribute of {@link StrictReferenceBase StrictReferenceBase}.
627 *
628 * @return the string with the year of publication
629 */
630 @Override
631 public String getYear(){
632 return this.year;
633 }
634
635 /**
636 * @see #getYear()
637 */
638 public void setYear(String year){
639 this.year = year;
640 }
641
642 //A specification of an electronic publication, often a preprint or a technical report
643 /**
644 * Returns the string specifying <i>this</i> BibTeX reference as an electronic
645 * publication (often a preprint or a technical report).<BR>
646 * The returned "eprint" attribute might correspond to one of the
647 * {@link eu.etaxonomy.cdm.model.common.AnnotatableEntity#getAnnotations() annotations}
648 * of {@link StrictReferenceBase StrictReferenceBase}.
649 *
650 * @return the string specifying <i>this</i> electronic BibTeX reference
651 */
652 public String getEprint(){
653 return this.eprint;
654 }
655
656 /**
657 * @see #getEprint()
658 */
659 public void setEprint(String eprint){
660 this.eprint = eprint;
661 }
662
663 /**
664 * Returns the string with miscellaneous extra information for <i>this</i> BibTeX
665 * reference.<BR>
666 * The returned "note" attribute corresponds to one of the {@link eu.etaxonomy.cdm.model.common.AnnotatableEntity#getAnnotations() annotations}
667 * of {@link StrictReferenceBase StrictReferenceBase}.
668 *
669 * @return the string with extra information for <i>this</i> BibTeX reference
670 */
671 public String getNote(){
672 return this.note;
673 }
674
675 /**
676 * @see #getNote()
677 */
678 public void setNote(String note){
679 this.note = note;
680 }
681
682 /**
683 * Returns the {@link BibtexEntryType entry type} of <i>this</i> BibTeX reference.
684 * BibTeX references are split by types which correspond to subclasses of
685 * {@link StrictReferenceBase StrictReferenceBase}.
686 *
687 * @return the BibTeX entry type of <i>this</i> BibTeX reference
688 */
689 public BibtexEntryType getType() {
690 return type;
691 }
692
693 /**
694 * @see #getType()
695 */
696 public void setType(BibtexEntryType type) {
697 this.type = type;
698 }
699
700 /* (non-Javadoc)
701 * @see eu.etaxonomy.cdm.model.reference.INomenclaturalReference#setDatePublished(eu.etaxonomy.cdm.model.common.TimePeriod)
702 */
703 public void setDatePublished(TimePeriod datePublished) {
704 //TODO
705 logger.warn("Not yet implemented");
706 }
707
708 /**
709 * Returns a formatted string containing the entire reference citation,
710 * including authors and other elements corresponding to <i>this</i> BibTeX
711 * reference.
712 *
713 * @see #getNomenclaturalCitation(String)
714 * @see ReferenceBase#getCitation()
715 */
716 // @Override
717 // @Transient
718 // public String getCitation(){
719 // return nomRefBase.getCitation();
720 // }
721
722 /**
723 * Returns a formatted string containing the entire citation used for
724 * nomenclatural purposes based on <i>this</i> BibTeX reference - including
725 * (abbreviated) title but not authors - and on the given details.
726 *
727 * @param microReference the string with the details (generally pages)
728 * within <i>this</i> BibTeX reference
729 * @return the formatted string representing the
730 * nomenclatural citation
731 * @see getCitation()
732 * @see INomenclaturalReference#getNomenclaturalCitation(String)
733 */
734 @Transient
735 public String getNomenclaturalCitation(String microReference) {
736 if (cacheStrategy == null){
737 logger.warn("No CacheStrategy defined for "+ this.getClass() + ": " + this.getUuid());
738 return null;
739 }else{
740 return cacheStrategy.getNomenclaturalCitation(this,microReference);
741 }
742 }
743
744
745 /**
746 * Generates, according to the {@link strategy.cache.reference.BibtexDefaultCacheStrategy default cache strategy}
747 * assigned to <i>this</i> BibTeX reference, a string that identifies <i>this</i>
748 * BibTeX reference and returns it. This string may be stored in the
749 * inherited {@link common.IdentifiableEntity#getTitleCache() titleCache} attribute.<BR>
750 * This method overrides the generic and inherited generateTitle method
751 * from {@link ReferenceBase ReferenceBase}.
752 *
753 * @return the string identifying <i>this</i> BibTeX reference
754 * @see #getCitation()
755 * @see eu.etaxonomy.cdm.model.common.IdentifiableEntity#getTitleCache()
756 * @see eu.etaxonomy.cdm.model.common.IdentifiableEntity#generateTitle()
757 */
758 // @Override
759 // public String generateTitle(){
760 // return nomRefBase.generateTitle();
761 // }
762
763
764 //****************** clone ********************** //
765
766
767 /**
768 * Clones <i>this</i> bibtex reference. This is a shortcut that enables to
769 * create a new instance that differs only slightly from <i>this</i> bibtext
770 * by modifying only some of the attributes.<BR>
771 * This method overrides the clone method from {@link ReferenceBase ReferenceBase}.
772 *
773 * @see ReferenceBase#clone()
774 * @see eu.etaxonomy.cdm.model.media.IdentifiableMediaEntity#clone()
775 * @see java.lang.Object#clone()
776 */
777 @Override
778 public BibtexReference clone(){
779 try{
780 BibtexReference result = (BibtexReference)super.clone();
781 result.cacheStrategy = BibtexDefaultCacheStrategy.NewInstance();
782 result.setCrossref(this.getCrossref());
783 //no changes to: crossref, type
784 return result;
785 } catch (CloneNotSupportedException e) {
786 logger.warn("Object does not implement cloneable");
787 e.printStackTrace();
788 return null;
789 }
790 }
791
792 }