Revision 531fc7bc
Added by Andreas Müller almost 8 years ago
cdmlib-ext/src/main/java/eu/etaxonomy/cdm/ext/openurl/OpenUrlReference.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2009 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
... | ... | |
16 | 16 |
|
17 | 17 |
import eu.etaxonomy.cdm.ext.openurl.MobotOpenUrlServiceWrapper.ReferenceType; |
18 | 18 |
import eu.etaxonomy.cdm.model.reference.Reference; |
19 |
import eu.etaxonomy.cdm.strategy.cache.reference.IReferenceBaseCacheStrategy; |
|
20 | 19 |
|
21 | 20 |
/** |
22 | 21 |
* @author a.kohlbecker |
23 | 22 |
* @date 16.12.2010 |
24 | 23 |
* |
25 | 24 |
*/ |
26 |
public class OpenUrlReference<S extends IReferenceBaseCacheStrategy> extends Reference<S> {
|
|
27 |
|
|
25 |
public class OpenUrlReference extends Reference {
|
|
26 |
|
|
28 | 27 |
|
29 | 28 |
private static final String PAGETHUMB_BASE_URI = "http://www.biodiversitylibrary.org/pagethumb/"; |
30 | 29 |
|
31 | 30 |
public static final Logger logger = Logger.getLogger(OpenUrlReference.class); |
32 | 31 |
|
33 | 32 |
private static final long serialVersionUID = 1L; |
34 |
|
|
33 |
|
|
35 | 34 |
private URI itemUri; |
36 |
|
|
35 |
|
|
37 | 36 |
private URI titleUri; |
38 |
|
|
37 |
|
|
39 | 38 |
private ReferenceType referenceType = null; |
40 | 39 |
|
41 | 40 |
/** |
42 | 41 |
* Links to the specific book or journal, that is to the front page |
43 |
*
|
|
42 |
* |
|
44 | 43 |
* @param itemUri the itemUri to set |
45 | 44 |
*/ |
46 | 45 |
public void setItemUri(URI itemUri) { |
... | ... | |
49 | 48 |
|
50 | 49 |
/** |
51 | 50 |
* Links to the according entry in the bibliography. |
52 |
*
|
|
51 |
* |
|
53 | 52 |
* @return the itemUri |
54 | 53 |
*/ |
55 | 54 |
public URI getItemUri() { |
... | ... | |
70 | 69 |
public URI getTitleUri() { |
71 | 70 |
return titleUri; |
72 | 71 |
} |
73 |
|
|
74 |
|
|
72 |
|
|
73 |
|
|
75 | 74 |
/** |
76 | 75 |
* Splits the id from the base ulr of the id urls used in bhl. For example the url string http://www.biodiversitylibrary.org/item/16772 will be split into |
77 | 76 |
* <ol> |
... | ... | |
105 | 104 |
*/ |
106 | 105 |
public ReferenceType getReferenceType() { |
107 | 106 |
return referenceType; |
108 |
}
|
|
109 |
|
|
107 |
} |
|
108 |
|
|
110 | 109 |
/** |
111 | 110 |
* This method will construct an URI pointing to a service which creates an |
112 | 111 |
* jpeg image. This may take a while. For more information please refer to |
... | ... | |
116 | 115 |
* This is usually much faster than requesting for a custom imge |
117 | 116 |
* size. |
118 | 117 |
* <p> |
119 |
*
|
|
118 |
* |
|
120 | 119 |
* @param width |
121 | 120 |
* width of the image, may be null or 0 |
122 | 121 |
* @param height |
... | ... | |
124 | 123 |
* @return |
125 | 124 |
*/ |
126 | 125 |
public URI getJpegImage(Integer width, Integer height){ |
127 |
|
|
126 |
|
|
128 | 127 |
URI imageURI = null; |
129 | 128 |
try { |
130 | 129 |
String sizeStr = ""; |
... | ... | |
133 | 132 |
} |
134 | 133 |
String[] tokens = splitPathAndId(getUri()); |
135 | 134 |
if(tokens.length == 2){ |
136 |
imageURI = new URI(PAGETHUMB_BASE_URI + tokens[1] + sizeStr);
|
|
135 |
imageURI = new URI(PAGETHUMB_BASE_URI + tokens[1] + sizeStr); |
|
137 | 136 |
} |
138 | 137 |
} catch (URISyntaxException e) { |
139 | 138 |
// should never happen, but let's report it anyway |
Also available in: Unified diff
Remove generics from Reference in cdmlib (except for cdmlib-model) #5830