Project

General

Profile

« Previous | Next » 

Revision e75cf4e4

Added by Andreas Müller over 8 years ago

clean up taxon cache strategy

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/taxon/TaxonBaseDefaultCacheStrategy.java
45 45
        return getTitleCache(taxonBase, null);
46 46
    }
47 47

  
48

  
49
//	@Override
50
//	public String getTitleCache(T taxonBase) {
51
//		String title;
52
//		if (taxonBase.isProtectedTitleCache()){
53
//		    return taxonBase.getTitleCache();
54
//		}else if (taxonBase.getName() != null && taxonBase.getName().getTitleCache() != null){
55
//			String namePart = getNamePart(taxonBase);
56
//
57
//			title = namePart + " sec. ";
58
//			title += getSecundumPart(taxonBase);
59
//		}else{
60
//			title = taxonBase.toString();
61
//		}
62
//		if (taxonBase.isDoubtful()){
63
//			title = "?" + title;
64
//		}
65
//		return title;
66
//	}
67

  
68
//	/**
69
//	 * @param taxonBase
70
//	 * @param title
71
//	 * @return
72
//	 */
73
//	private String getSecundumPart(T taxonBase) {
74
//		String result;
75
//		Reference<?> sec = taxonBase.getSec();
76
//		if (sec != null){
77
//			if (sec.getCacheStrategy() != null &&
78
//					sec.getAuthorship() != null &&
79
//					isNotBlank(sec.getAuthorship().getTitleCache()) &&
80
//					isNotBlank(sec.getYear())){
81
//				result = sec.getCacheStrategy().getCitation(sec);
82
////				 sec.getAuthorTeam().getTitleCache() + sec.getYear();
83
//			}else{
84
//				result = taxonBase.getSec().getTitleCache();
85
//			}
86
//		}else{
87
//			result = "???";
88
//		}
89
//		return result;
90
//	}
91

  
92
//	/**
93
//	 * @param name
94
//	 */
95
//	private String getNamePart(TaxonBase<?> taxonBase) {
96
//		TaxonNameBase<?,?> nameBase = taxonBase.getName();
97
//		String result = nameBase.getTitleCache();
98
//		//use name cache instead of title cache if required
99
//		if (taxonBase.isUseNameCache() && nameBase.isInstanceOf(NonViralName.class)){
100
//			NonViralName<?> nvn = HibernateProxyHelper.deproxy(nameBase, NonViralName.class);
101
//			result = nvn.getNameCache();
102
//		}
103
//		if (StringUtils.isNotBlank(taxonBase.getAppendedPhrase())){
104
//			result = result.trim() + " " +  taxonBase.getAppendedPhrase().trim();
105
//		}
106
//		return result;
107
//	}
108

  
109 48
    @Override
110 49
    public List<TaggedText> getTaggedTitle(T taxonBase) {
111 50
        if (taxonBase == null){

Also available in: Unified diff