Project

General

Profile

« Previous | Next » 

Revision 71b9b632

Added by Andreas Müller almost 3 years ago

ref #4311 first implementation for TeamOrPersonBase.collectorTitle

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/agent/TeamOrPersonBase.java
35 35
@XmlAccessorType(XmlAccessType.FIELD)
36 36
@XmlType(name = "TeamOrPersonBase", propOrder = {
37 37
    "nomenclaturalTitle",
38
    "collectorTitle"
38
    "collectorTitleCache"
39 39
})
40 40
@Entity
41 41
@Audited
......
54 54
    protected String nomenclaturalTitle;
55 55

  
56 56
    //under construction #4311
57
    @XmlElement(name="CollectorTitle")
57
    @XmlElement(name="CollectorTitleCache")
58 58
    @Field(index=Index.YES)
59
    @Column(length=255)
60
    protected String collectorTitle;
59
    @Column(length=800)//see #1592
60
    protected String collectorTitleCache;
61 61

  
62 62
//  from E+M import (still needed?)
63 63
//    @Column(length=255)
......
69 69
    @XmlTransient
70 70
    protected boolean isGeneratingTitleCache = false;  //state variable to avoid recursions when generating title cache and nomenclatural title
71 71

  
72

  
73
    //#4311
74
    public String getCollectorTitleCache() {
75
        // is title dirty, i.e. equal NULL?
76
        if (collectorTitleCache == null){
77
            this.collectorTitleCache = generateCollectorTitleCache();
78
            this.collectorTitleCache = getTruncatedCache(this.collectorTitleCache) ;
79
        }
80
        return collectorTitleCache;
81
    }
82
    public void setCollectorTitleCache(String collectorTitleCache) {
83
        //TODO
84
        this.collectorTitleCache = collectorTitleCache;
85
    }
86

  
87
    @SuppressWarnings("unchecked")
88
    private String generateCollectorTitleCache() {
89
        if (getCacheStrategy() == null){
90
            return this.getClass() + ": " + this.getUuid();
91
        }else{
92
            return getCacheStrategy().getCollectorTitleCache((T)this);
93
        }
94
    }
95

  
72 96
    /**
73 97
     * Returns the identification string (nomenclatural abbreviation) used in
74 98
     * nomenclature for this {@link Person person} or this {@link Team team}.

Also available in: Unified diff