Project

General

Profile

« Previous | Next » 

Revision bc556475

Added by Andreas Müller almost 8 years ago

Some further cleaning up for single reference cache strategy #5833

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/IArticle.java
5 5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/ 
8
*/
9 9

  
10 10
package eu.etaxonomy.cdm.model.reference;
11 11

  
12 12
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
13
import eu.etaxonomy.cdm.strategy.cache.reference.old.ArticleDefaultCacheStrategy;
14 13

  
15 14
/**
16 15
 * This interface represents articles in a {@link IJournal journal}. An article is an independent
......
25 24
 * </ul>
26 25
 */
27 26
public interface IArticle extends ISection, IVolumeReference, INomenclaturalReference{
28
	
27

  
29 28
	/**
30 29
	 * Returns the series information for this article
31 30
	 */
......
36 35
	 * @param series
37 36
	 */
38 37
	public void setSeriesPart(String series);
39
	
40
	
41
	
38

  
39

  
40

  
42 41
	/**
43 42
	 * Returns this articles journal.
44 43
	 * @return
45 44
	 */
46 45
	public IJournal getInJournal();
47
	
48
	
46

  
47

  
49 48
	/**
50
	 * Sets this articles journal 
49
	 * Sets this articles journal
51 50
	 * @param journal
52 51
	 */
53 52
	public void setInJournal(IJournal journal);
54 53

  
55
	
56
	void setCacheStrategy(ArticleDefaultCacheStrategy cacheStrategy);
57 54
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/IBook.java
5 5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/ 
8
*/
9 9

  
10 10
package eu.etaxonomy.cdm.model.reference;
11 11

  
12
import eu.etaxonomy.cdm.strategy.cache.reference.old.BookDefaultCacheStrategy;
13

  
14 12
/**
15
 * This interface represents books. A book is a  {@link IPrintedUnitBase printed unit} 
13
 * This interface represents books. A book is a  {@link IPrintedUnitBase printed unit}
16 14
 * usually published by a publishing company.
17 15
 * <P>
18 16
 * This class corresponds, according to the TDWG ontology, to the publication type
......
22 20
 * </ul>
23 21
 */
24 22
public interface IBook extends IPrintedUnitBase, INomenclaturalReference{
25
	
23

  
26 24
	/**
27 25
	 * Returns this books edition
28 26
	 */
......
33 31
	 * @param edition
34 32
	 */
35 33
	public void setEdition(String edition);
36
	
37
	
34

  
35

  
38 36
	/**
39 37
	 * Returns this books isbn (international standard book number)
40 38
	 */
41 39
	public String getIsbn();
42
	
40

  
43 41
	/**
44 42
	 * Sets this books isbn (international standard book number)
45 43
	 * @param isbn
46 44
	 */
47 45
	public void setIsbn(String isbn);
48
	
49
	
50
	void setCacheStrategy(BookDefaultCacheStrategy cacheStrategy);
51
	
52
	
53 46

  
54 47

  
55 48
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/IBookSection.java
5 5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/ 
8
*/
9 9

  
10 10
package eu.etaxonomy.cdm.model.reference;
11 11

  
12
import eu.etaxonomy.cdm.strategy.cache.reference.old.BookSectionDefaultCacheStrategy;
13

  
14 12
/**
15
 * This interface represents isolated sections (parts or chapters) within a 
13
 * This interface represents isolated sections (parts or chapters) within a
16 14
 * {@link IBook book} or {@link IProceedings proceedings}.
17 15
 * <P>
18 16
 * This class corresponds, according to the TDWG ontology, to the publication type
......
25 23
	 * @return
26 24
	 */
27 25
	public IBook getInBook();
28
	
26

  
29 27
	/**
30 28
	 * Sets this book sections book.
31 29
	 * @param book
32 30
	 */
33 31
	public void setInBook (IBook book);
34 32

  
35
	
36
	
37
	void setCacheStrategy(BookSectionDefaultCacheStrategy cacheStratefy);
38

  
39 33
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/IGeneric.java
5 5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/ 
8
*/
9 9

  
10 10
package eu.etaxonomy.cdm.model.reference;
11 11

  
12
import eu.etaxonomy.cdm.strategy.cache.reference.old.GenericDefaultCacheStrategy;
13

  
14 12
/**
15 13
 * This interface represents all references which cannot be clearly assigned to a
16 14
 * particular {@link StrictReferenceBase reference} subclass. Therefore attributes which are
......
33 31
	 * Returns the editor of this generic reference
34 32
	 */
35 33
	public String getEditor();
36
	
34

  
37 35
	/**
38 36
	 * Sets the editor for this generic reference
39 37
	 * @param editor
40 38
	 */
41 39
	public void setEditor(String editor);
42
	
40

  
43 41
	/**
44 42
	 * Returns the series of this generic reference
45 43
	 */
46 44
	public String getSeriesPart();
47
	
45

  
48 46
	/**
49 47
	 * Sets the series for this generic reference
50 48
	 * @param series
51 49
	 */
52 50
	public void setSeriesPart(String series);
53
	
51

  
54 52
	/**
55
	 * Returns the pages (page span this reference covers in its in-reference) 
53
	 * Returns the pages (page span this reference covers in its in-reference)
56 54
	 */
57 55
	public String getPages();
58
	
56

  
59 57
	/**
60
	 * Sets the pages (page span this reference covers in its in-reference) 
58
	 * Sets the pages (page span this reference covers in its in-reference)
61 59
	 * @param pages
62 60
	 */
63 61
	public void setPages(String pages);
......
66 64
	 * Returns the inreference of this generic reference
67 65
	 */
68 66
	public IGeneric getInReference();
69
	
67

  
70 68
	/**
71 69
	 * Sets the inreference.
72 70
	 * @param inReference
73 71
	 */
74 72
	public void setInReference(Reference inReference);
75 73

  
76
	void setCacheStrategy(GenericDefaultCacheStrategy cacheStratefy);
77
	
78 74
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/IJournal.java
5 5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/ 
8
*/
9 9

  
10 10
package eu.etaxonomy.cdm.model.reference;
11 11

  
12
import eu.etaxonomy.cdm.strategy.cache.reference.old.JournalDefaultCacheStrategy;
13

  
14 12
/**
15
 * This interface represents journals. A journal is a periodical 
13
 * This interface represents journals. A journal is a periodical
16 14
 * {@link IPublicationBase publication} containing several {@link IArticle articles}.
17 15
 * <P>
18 16
 * This class corresponds, according to the TDWG ontology, to the publication type
......
24 22
	 * Returns the ISSN (International Standard Serial Number)
25 23
	 */
26 24
	public String getIssn();
27
	
25

  
28 26
	/**
29 27
	 * Sets the ISSN (International Standard Serial Number)
30 28
	 * @param issn
31 29
	 */
32 30
	public void setIssn(String issn);
33
	
34
	void setCacheStrategy(JournalDefaultCacheStrategy cacheStrategy);
35
	
31

  
36 32
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/INomenclaturalReference.java
1 1
/**
2 2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
3
* European Distributed Institute of Taxonomy
4 4
* http://www.e-taxonomy.eu
5
* 
5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
......
10 10
package eu.etaxonomy.cdm.model.reference;
11 11

  
12 12
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
13
import eu.etaxonomy.cdm.model.common.TimePeriod;
13
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
14 14

  
15 15

  
16 16
 /**
17
 * Interface providing methods for nomenclatural references. 
18
 * 
17
 * Interface providing methods for nomenclatural references.
18
 *
19 19
 * @author m.doering
20 20
 * @created 08-Nov-2007 13:06:29
21 21
 */
22
public interface INomenclaturalReference extends IReference{
22
public interface INomenclaturalReference  extends IReference{
23 23

  
24 24
	public final String MICRO_REFERENCE_TOKEN = "@@MicroReference";
25
	
25

  
26

  
26 27
	/**
27
	 * Returns a formatted string containing the reference citation excluding
28
	 * authors but including the details as used in a {@link TaxonNameBase taxon name}.
29
	 */
30
	public String getNomenclaturalCitation(String  microReference);
28
     * Returns the citation string including the details (micro reference) information
29
     * from {@link TaxonNameBase taxon name}.
30
     * E.g. if the references title cache is <i>L., Sp. Pl. 3. 1757</i> the nomenclatural citation
31
     * may be something like <i>L., Sp. Pl. 3: 45. 1757</i>
32
     *
33
     * @param microReference the detail, e.g. a page number, a figure, ...
34
     * @return String
35
     */
36
    public String getNomenclaturalCitation(String microReference);
31 37

  
32 38
	/**
33 39
	 * Returns a string representation for the year of publication / creation
......
35 41
	 */
36 42
	public String getYear();
37 43

  
38
	public void setDatePublished(TimePeriod datePublished);
39
	
40
	
44

  
45

  
41 46
	/**
42 47
	 * Returns the cached value for the abbreviated representation of this reference.
43
	 * The abbreviated representation will normally use the {@link #getAbbrevTitle() 
48
	 * The abbreviated representation will normally use the {@link #getAbbrevTitle()
44 49
	 * abbreviated title } instead of the {@link Reference#getTitle() full title}.
45 50
	 * The cache may be protected.
46 51
	 * @see #getAbbrevTitle()
......
48 53
	 * @see #isProtectedAbbrevTitleCache()
49 54
	 * @return the abbreviated representation of this reference
50 55
	 */
51
	//TODO discuss if we move all the abbreviated title methods to another interface, e.g. IReference 
56
	//TODO discuss if we move all the abbreviated title methods to another interface, e.g. IReference
52 57
	public String getAbbrevTitleCache();
53
	
58

  
54 59
	/**
55 60
	 * Sets the {@link #getAbbrevTitleCache() abbreviated title cache}
56
	 * 
61
	 *
57 62
	 * @param abbrevTitleCache
58 63
	 * @deprecated this method exists only for compliance with the java bean standard.
59
	 * It usually has little effect as it will not protect the cache. 
64
	 * It usually has little effect as it will not protect the cache.
60 65
	 * Use {@link #setAbbrevTitleCache(String, boolean)} instead to protect the cache.
61 66
	 */
62
	public void setAbbrevTitleCache(String abbrevTitleCache);
67
	@Deprecated
68
    public void setAbbrevTitleCache(String abbrevTitleCache);
63 69

  
64 70
	/**
65 71
	 * Sets the {@link #getAbbrevTitleCache() abbreviated title cache}.
66
	 * 
72
	 *
67 73
	 * @param abbrevTitleCache
68 74
	 * @param isProtected wether or not the cache should be protected. Usually one may
69 75
	 * want to set isProtected to <code>true</code>
70 76
	 */
71 77
	public void setAbbrevTitleCache(String abbrevTitleCache, boolean isProtected);
72 78

  
73
	
79

  
74 80
	/**
75
	 * If true the {@link #getAbbrevTitleCache() abbreviated title cache} is not computed 
81
	 * If true the {@link #getAbbrevTitleCache() abbreviated title cache} is not computed
76 82
	 * on the fly but set by {@link #setAbbrevTitleCache(String)}.
77 83
	 * @see IIdentifiableEntity#isProtectedTitleCache()
78 84
	 * @return true if cache is protected
79 85
	 */
80 86
	public boolean isProtectedAbbrevTitleCache();
81
	
87

  
82 88
	/**
83 89
	 * Sets the protected flag for the {@link #getAbbrevTitleCache() abbreviated title cache}.
84 90
	 * @param protectedAbbrevTitleCache
85 91
	 */
86 92
	public void setProtectedAbbrevTitleCache(boolean protectedAbbrevTitleCache);
87
	
88

  
89
	/**
90
	 * The abbreviated title is the short form for the titlle. It is usually used
91
	 * as a representation of the title of references used in a nomenclatural 
92
	 * context.  
93
	 * @return
94
	 */
95
	public String getAbbrevTitle();
96 93

  
97
	/**
98
	 * Sets the {@link #getAbbrevTitle() abbreviated title}.
99
	 * @param abbrevTitle
100
	 */
101
	public void setAbbrevTitle(String abbrevTitle);
102 94
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/IReference.java
5 5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/ 
8
*/
9 9

  
10 10
package eu.etaxonomy.cdm.model.reference;
11 11

  
......
21 21

  
22 22

  
23 23
/**
24
 * The upmost interface for references (information sources). 
24
 * The upmost interface for references (information sources).
25 25
 * <P>
26 26
 * This class corresponds to: <ul>
27 27
 * <li> PublicationCitation according to the TDWG ontology
......
29 29
 * <li> Reference according to the ABCD schema
30 30
 * </ul>
31 31
 */
32
public interface IReference extends IIdentifiableEntity, IParsable, IMergable, IMatchable, Cloneable {
32
public interface IReference
33
            extends IIdentifiableEntity,
34
                   IParsable, IMergable, IMatchable, Cloneable {
33 35

  
34 36
	/**
35 37
	 * Returns the reference type
36 38
	 */
37 39
	public ReferenceType getType() ;
38
	
40

  
39 41
	/**
40 42
	 * Sets the reference type
41 43
	 * @param type
42 44
	 */
43 45
	public void setType(ReferenceType type) ;
44
	
46

  
45 47
	/**
46 48
	 * Returns true if the type of the reference is the same as the passed parameter
47 49
	 * @param type
48 50
	 * @return boolean
49 51
	 */
50 52
	public boolean isOfType(ReferenceType type);
51
	
53

  
52 54
	/**
53 55
	 * Returns the references author(s)
54 56
	 */
55 57
	public TeamOrPersonBase getAuthorship();
56
	
58

  
57 59
	/**
58 60
	 * Sets the references author(s)
59 61
	 */
60 62
	public void setAuthorship(TeamOrPersonBase authorship);
61
	
63

  
62 64
	/**
63 65
	 * Returns the references title
64 66
	 */
65 67
	public String getTitle();
66
	
67
	
68
	/**
69
	 * Returns the references title
70
	 */
71
	public String getAbbrevTitle();
72
		
68

  
73 69
	/**
74 70
	 * Sets the references title
75 71
	 * @param title
76 72
	 */
77 73
	public void setTitle(String title);
78 74

  
79
	
80
	/**
81
	 * Sets the references abbreviated title
82
	 * @param title
83
	 */
84
	public void setAbbrevTitle(String abbrevTitle);
85 75

  
86
	
76

  
77
    /**
78
     * The abbreviated title is the short form for the titlle. It is usually used
79
     * as a representation of the title of references used in a nomenclatural
80
     * context.
81
     * @return
82
     */
83
    public String getAbbrevTitle();
84

  
85
    /**
86
     * Sets the {@link #getAbbrevTitle() abbreviated title}.
87
     * @param abbrevTitle
88
     */
89
    public void setAbbrevTitle(String abbrevTitle);
90

  
91

  
87 92
	/**
88 93
	 * Returns the date when the reference was published as a {@link TimePeriod}
89 94
	 */
90 95
	public TimePeriod getDatePublished();
91
	
96

  
92 97
	/**
93 98
	 * Sets the date when the reference was published.
94 99
	 */
95
	public void setDatePublished(TimePeriod datePublished);
96
	
100
    public void setDatePublished(TimePeriod datePublished);
101

  
97 102
	/**
98 103
	 * Returns the Uniform Resource Identifier (URI) corresponding to <i>this</i>
99 104
	 * reference. An URI is a string of characters used to identify a resource
100 105
	 * on the Internet.
101
	 * 
106
	 *
102 107
	 * @return  the URI of <i>this</i> reference
103 108
	 */
104 109
	public URI getUri();
......
107 112
	 */
108 113
	public void setUri(URI uri);
109 114

  
110
	
115

  
111 116
	/**
112 117
	 * Returns the references abstract which is a summary of the content
113 118
	 */
114 119
	public String getReferenceAbstract();
115
	
120

  
116 121
	/**
117 122
	 * Sets the references abstract which is a summary of the content
118 123
	 * @param referenceAbstract
119 124
	 */
120 125
	public void setReferenceAbstract(String referenceAbstract);
121
		
122
	/**
123
	 * Returns the citation string including the detail (micro reference) information.
124
	 * E.g. if the references title cache is <i>L., Sp. Pl. 3. 1757</i> the nomenclatural citation
125
	 * may be something like <i>L., Sp. Pl. 3: 45. 1757</i>
126
	 * @param microReference the detail, e.g. a page number, a figure, ...
127
	 * @return String
128
	 */
129
	public String getNomenclaturalCitation(String microReference);
130
	
131
	/**
132
	 * Sets the cache strategy for this reference
133
	 * @param cacheStrategy
134
	 */
135
	void setCacheStrategy(IReferenceCacheStrategy cacheStrategy);
136
	
126

  
127
    /**
128
     * @param defaultStrategy
129
     */
130
    public void setCacheStrategy(IReferenceCacheStrategy defaultStrategy);
131

  
137 132
	/**
138 133
	 * @see Cloneable
139 134
	 * @return
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/Reference.java
56 56
import eu.etaxonomy.cdm.strategy.cache.reference.INomenclaturalReferenceCacheStrategy;
57 57
import eu.etaxonomy.cdm.strategy.cache.reference.IReferenceCacheStrategy;
58 58
import eu.etaxonomy.cdm.strategy.cache.reference.NewDefaultReferenceCacheStrategy;
59
import eu.etaxonomy.cdm.strategy.cache.reference.old.ArticleDefaultCacheStrategy;
60
import eu.etaxonomy.cdm.strategy.cache.reference.old.BookDefaultCacheStrategy;
61
import eu.etaxonomy.cdm.strategy.cache.reference.old.BookSectionDefaultCacheStrategy;
62
import eu.etaxonomy.cdm.strategy.cache.reference.old.GenericDefaultCacheStrategy;
63
import eu.etaxonomy.cdm.strategy.cache.reference.old.JournalDefaultCacheStrategy;
64
import eu.etaxonomy.cdm.strategy.cache.reference.old.ReferenceDefaultCacheStrategy;
65 59
import eu.etaxonomy.cdm.strategy.match.Match;
66 60
import eu.etaxonomy.cdm.strategy.match.MatchMode;
67 61
import eu.etaxonomy.cdm.strategy.merge.Merge;
......
75 69
import eu.etaxonomy.cdm.validation.annotation.ReferenceCheck;
76 70

  
77 71
/**
78
 * The upmost (abstract) class for references (information sources).
72
 * The class for references (information sources). Originally
73
 * an abstract class with many subclasses. Not it is only
74
 * one class implementing many interfaces for safe use.
79 75
 * <P>
80 76
 * This class corresponds to: <ul>
81 77
 * <li> PublicationCitation according to the TDWG ontology
......
123 119
@InReference(groups=Level3.class)
124 120
@NoRecursiveInReference(groups=Level3.class)  //may become Level1 in future  #
125 121
public class Reference
126
//        <S extends IReferenceBaseCacheStrategy>
127 122
        extends IdentifiableMediaEntity<IReferenceCacheStrategy>
128
        implements INomenclaturalReference, IArticle, IBook, IPatent, IDatabase, IJournal, IBookSection,ICdDvd,IGeneric,IInProceedings, IProceedings, IPrintSeries, IReport, IThesis,IWebPage, IPersonalCommunication, IReference, Cloneable {
123
        implements IArticle, IBook, IPatent, IDatabase, IJournal, IBookSection,ICdDvd,
124
                   IGeneric,IInProceedings, IProceedings, IPrintSeries, IReport,
125
                   IThesis,IWebPage, IPersonalCommunication,
126
                   INomenclaturalReference, IReference,
127
                   Cloneable {
129 128

  
130 129
    private static final long serialVersionUID = -2034764545042691295L;
131 130
	private static final Logger logger = Logger.getLogger(Reference.class);
......
374 373
		if (protectedAbbrevTitleCache){
375 374
            return this.abbrevTitleCache;
376 375
        }
377
        // is title dirty, i.e. equal NULL?
376
        // is reference dirty, i.e. equal NULL?
378 377
        if (abbrevTitleCache == null){
379 378
            this.abbrevTitleCache = generateAbbrevTitle();
380 379
            this.abbrevTitleCache = getTruncatedCache(this.abbrevTitleCache) ;
......
836 835

  
837 836
	@Override
838 837
    @Transient
839
	public String getNomenclaturalCitation(String microReference) {
838
    public String getNomenclaturalCitation(String microReference) {
840 839
		rectifyCacheStrategy();
841 840
		String typeName = this.getType()== null ? "(no type defined)" : this.getType().getMessage();
842 841
		if (getCacheStrategy() == null){
843 842
			logger.warn("No CacheStrategy defined for "+ typeName + ": " + this.getUuid());
844 843
			return null;
845 844
		}else{
846
			if (getCacheStrategy() instanceof INomenclaturalReferenceCacheStrategy){
845
		    if (getCacheStrategy() instanceof INomenclaturalReferenceCacheStrategy){
847 846
				return ((INomenclaturalReferenceCacheStrategy)cacheStrategy).getNomenclaturalCitation(this, microReference);
848 847
			}else {
849 848
				logger.warn("No INomenclaturalReferenceCacheStrategy defined for "+ typeName + ": " + this.getUuid());
......
1045 1044

  
1046 1045
	}
1047 1046

  
1048
	@Override
1049
    public void setCacheStrategy(ArticleDefaultCacheStrategy cacheStrategy) {
1050
		this.cacheStrategy = cacheStrategy;
1051
	}
1052

  
1053
	@Override
1054
    public void setCacheStrategy(BookDefaultCacheStrategy cacheStrategy) {
1055
		this.cacheStrategy = cacheStrategy;
1056
	}
1057

  
1058
	@Override
1059
    public void setCacheStrategy(JournalDefaultCacheStrategy cacheStrategy) {
1060
		this.cacheStrategy = cacheStrategy;
1061
	}
1062

  
1063
	@Override
1064
    public void setCacheStrategy(BookSectionDefaultCacheStrategy cacheStrategy) {
1065
		this.cacheStrategy = cacheStrategy;
1066
	}
1067

  
1068
	@Override
1069
    public void setCacheStrategy(GenericDefaultCacheStrategy cacheStrategy) {
1070
		this.cacheStrategy = cacheStrategy;
1071
	}
1072

  
1073
	public void setCacheStrategy(ReferenceDefaultCacheStrategy cacheStrategy) {
1074
		this.cacheStrategy = cacheStrategy;
1075

  
1076
	}
1077 1047

  
1078 1048

  
1079 1049

  
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/ReferenceType.java
22 22
import eu.etaxonomy.cdm.model.common.EnumeratedTermVoc;
23 23
import eu.etaxonomy.cdm.model.common.IEnumTerm;
24 24
import eu.etaxonomy.cdm.model.common.Language;
25
import eu.etaxonomy.cdm.strategy.cache.reference.INomenclaturalReferenceCacheStrategy;
25 26
import eu.etaxonomy.cdm.strategy.cache.reference.IReferenceCacheStrategy;
26 27
import eu.etaxonomy.cdm.strategy.cache.reference.NewDefaultReferenceCacheStrategy;
27 28
import eu.etaxonomy.cdm.strategy.cache.reference.old.ArticleDefaultCacheStrategy;
......
134 135
	}
135 136

  
136 137

  
137
	public IReferenceCacheStrategy getCacheStrategy(){
138
	public INomenclaturalReferenceCacheStrategy getCacheStrategy(){
138 139
//		if (true){
139 140
		    return NewDefaultReferenceCacheStrategy.NewInstance();
140 141
//		}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/name/NonViralNameDefaultCacheStrategy.java
33 33
import eu.etaxonomy.cdm.model.name.Rank;
34 34
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
35 35
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
36
import eu.etaxonomy.cdm.model.reference.Reference;
36 37
import eu.etaxonomy.cdm.strategy.cache.HTMLTagRules;
37 38
import eu.etaxonomy.cdm.strategy.cache.TagEnum;
38 39
import eu.etaxonomy.cdm.strategy.cache.TaggedCacheHelper;
......
333 334
        //reference
334 335
        String microReference = nonViralName.getNomenclaturalMicroReference();
335 336
        INomenclaturalReference ref = nonViralName.getNomenclaturalReference();
336
        String referenceBaseCache = null;
337
        String referenceCache = null;
337 338
        if (ref != null){
338
            INomenclaturalReference nomenclaturalReference = HibernateProxyHelper.deproxy(ref, INomenclaturalReference.class);
339
            nomenclaturalReference.setCacheStrategy(nomenclaturalReference.getType().getCacheStrategy());
340
            referenceBaseCache = nomenclaturalReference.getNomenclaturalCitation(microReference);
339
            Reference reference = HibernateProxyHelper.deproxy(ref, Reference.class);
340
            //FIXME #5833 not needed anymore
341
            reference.setCacheStrategy(reference.getType().getCacheStrategy());
342
            referenceCache = reference.getNomenclaturalCitation(microReference);
341 343
        }
342 344
            //add to tags
343
        if (StringUtils.isNotBlank(referenceBaseCache)){
344
            if (! referenceBaseCache.trim().startsWith("in ")){
345
        if (StringUtils.isNotBlank(referenceCache)){
346
            if (! referenceCache.trim().startsWith("in ")){
345 347
                String refConcat = ", ";
346 348
                tags.add(new TaggedText(TagEnum.separator, refConcat));
347 349
            }
348
            tags.add(new TaggedText(TagEnum.reference, referenceBaseCache));
350
            tags.add(new TaggedText(TagEnum.reference, referenceCache));
349 351
        }
350 352

  
351 353
        //nomenclatural status
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/reference/NewDefaultReferenceCacheStrategyTest.java
557 557
// ********************************** WEB PAGE ********************************************/
558 558

  
559 559
    @Test
560
//    @Ignore //under development
560
    @Ignore //under development
561 561
    public void testWebPageGetTitleCache(){
562 562
        webPage1.setTitle("Flora of Israel Online");
563 563
        webPage1.setUri(URI.create("http://flora.huji.ac.il"));
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImplTest.java
48 48
import eu.etaxonomy.cdm.model.reference.IBookSection;
49 49
import eu.etaxonomy.cdm.model.reference.IJournal;
50 50
import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;
51
import eu.etaxonomy.cdm.model.reference.IReference;
51 52
import eu.etaxonomy.cdm.model.reference.IVolumeReference;
52 53
import eu.etaxonomy.cdm.model.reference.Reference;
53 54
import eu.etaxonomy.cdm.model.reference.ReferenceType;
......
375 376
        assertFalse(multipleAuthorRefName.hasProblem());
376 377
        assertTrue("Combination author should be a person", multipleAuthorRefName.getCombinationAuthorship() instanceof Person);
377 378
        assertEquals("Combination author should be L.", "L.", ((Person)multipleAuthorRefName.getCombinationAuthorship()).getNomenclaturalTitle());
378
        INomenclaturalReference nomRef = multipleAuthorRefName.getNomenclaturalReference();
379
        IReference nomRef = multipleAuthorRefName.getNomenclaturalReference();
379 380
        Assert.assertNotNull("nomRef must have inRef", ((Reference)nomRef).getInReference());
380 381
        Reference inRef = ((Reference)nomRef).getInReference();
381 382
        String title = inRef.getTitle();

Also available in: Unified diff