Project

General

Profile

Revision cd9d6a50

IDcd9d6a5003c3dadc97f822acd1b8134b64c8a076
Parent 64cd247e
Child 0d6a5e24

Added by Andreas Müller over 2 years ago

cleanup

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/ImageFile.java
28 28

  
29 29
/**
30 30
 * @author m.doering
31
 * @version 1.0
32 31
 * @created 08-Nov-2007 13:06:28
33 32
 */
34 33
@XmlAccessorType(XmlAccessType.FIELD)
cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/media/MediaUtilsTest.java
58 58

  
59 59
        mediaAudio1 = Media.NewInstance();
60 60
        mediaAudio1.addRepresentation(bigMP3Representation);
61

  
62

  
63 61
    }
64 62

  
65 63
    private Media findMediaByUUID(Collection<Media> mediaList, UUID uuid){
......
74 72
    @Test
75 73
    public void testFindPreferredMedia(){
76 74

  
77
        ArrayList<Media> imageList = new ArrayList<Media>();
75
        ArrayList<Media> imageList = new ArrayList<>();
78 76
        imageList.add(mediaImage1);
79 77
        imageList.add(mediaImage2);
80 78
        imageList.add(mediaImage3);
81 79

  
82
        Map<Media, MediaRepresentation> filteredList = MediaUtils.findPreferredMedia(imageList, ImageFile.class, null, null, null, null, null);
80
        Map<Media, MediaRepresentation> filteredList = MediaUtils.findPreferredMedia(
81
                imageList, ImageFile.class, null, null, null, null, null);
83 82

  
84 83
        Assert.assertNotNull(findMediaByUUID(filteredList.keySet(), mediaImage1.getUuid()));
85 84
        Assert.assertNotNull(findMediaByUUID(filteredList.keySet(), mediaImage2.getUuid()));
86 85
        Assert.assertNotNull(findMediaByUUID(filteredList.keySet(), mediaImage3.getUuid()));
87 86

  
88
        ArrayList<Media> mixedMediaList =  new ArrayList<Media>();
87
        ArrayList<Media> mixedMediaList =  new ArrayList<>();
89 88
        mixedMediaList.add(mediaImage1);
90 89
        mixedMediaList.add(mediaImage2);
91 90
        mixedMediaList.add(mediaImage3);
......
111 110

  
112 111
        String[] mimetypes = {".*"};
113 112

  
114
        Assert.assertEquals(smallJPGRepresentation, MediaUtils.findBestMatchingRepresentation(mediaImage1, null, null, 200, 300, mimetypes));
115
        Assert.assertEquals(bigJPGRepresentation, MediaUtils.findBestMatchingRepresentation(mediaImage1, null, null, 1500, 1500, mimetypes));
113
        Assert.assertEquals(smallJPGRepresentation, MediaUtils.findBestMatchingRepresentation(
114
                mediaImage1, null, null, 200, 300, mimetypes));
115
        Assert.assertEquals(bigJPGRepresentation, MediaUtils.findBestMatchingRepresentation(
116
                mediaImage1, null, null, 1500, 1500, mimetypes));
116 117

  
117
        Assert.assertEquals(smallJPGRepresentation, MediaUtils.findBestMatchingRepresentation(mediaImage1, null, 300, null, null, mimetypes));
118
        Assert.assertEquals(bigJPGRepresentation, MediaUtils.findBestMatchingRepresentation(mediaImage1, null, 1500, null, null, mimetypes));
118
        Assert.assertEquals(smallJPGRepresentation, MediaUtils.findBestMatchingRepresentation(
119
                mediaImage1, null, 300, null, null, mimetypes));
120
        Assert.assertEquals(bigJPGRepresentation, MediaUtils.findBestMatchingRepresentation(
121
                mediaImage1, null, 1500, null, null, mimetypes));
119 122

  
120 123
    }
121 124

  
122

  
123

  
124 125
}
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/hibernate/CdmSecurityHibernateInterceptor.java
89 89
//        exculdeMap.get(TaxonName.class).add("taxonBases");
90 90
    }
91 91

  
92

  
93
    /* (non-Javadoc)
94
     * @see org.hibernate.EmptyInterceptor#onSave(java.lang.Object, java.io.Serializable, java.lang.Object[], java.lang.String[], org.hibernate.type.Type[])
95
     */
96 92
    @Override
97 93
    public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] type) {
98 94

  
......
105 101
        return true;
106 102
    }
107 103

  
108

  
109
    /* (non-Javadoc)
110
     * @see org.hibernate.EmptyInterceptor#onFlushDirty(java.lang.Object, java.io.Serializable, java.lang.Object[], java.lang.Object[], java.lang.String[], org.hibernate.type.Type[])
111
     */
112 104
    @Override
113 105
    public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) {
114 106

  
......
140 132
    }
141 133

  
142 134

  
143

  
144
    /* (non-Javadoc)
145
     * @see org.hibernate.EmptyInterceptor#onDelete(java.lang.Object, java.io.Serializable, java.lang.Object[], java.lang.String[], org.hibernate.type.Type[])
146
     */
147 135
    @Override
148 136
    public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) {
149 137

  
......
257 245
        return propertyIsModified(currentState, previousState, key);
258 246
    }
259 247

  
260

  
261 248
}
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ClassificationServiceImpl.java
480 480

  
481 481
    }
482 482

  
483
    @Override
484
    public Map<UUID, List<MediaRepresentation>> getAllMediaForChildNodes(Taxon taxon, Classification taxTree, List<String> propertyPaths, int size, int height, int widthOrDuration, String[] mimeTypes){
485
        TaxonNode node = taxTree.getNode(taxon);
486

  
487
        return getAllMediaForChildNodes(node, propertyPaths, size, height, widthOrDuration, mimeTypes);
488
    }
489 483

  
490 484
    @Override
491 485
    @Transactional(readOnly = false)
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IClassificationService.java
204 204
    public List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification);
205 205

  
206 206
    /**
207
     * @param taxon
208
     * @param taxTree
209
     * @param propertyPaths
210
     * @param size
211
     * @param height
212
     * @param widthOrDuration
213
     * @param mimeTypes
214
     * @return
215
     *
216
     * @deprecated use getAllMediaForChildNodes(TaxonNode taxonNode, ...) instead
217
     * if you have a classification and a taxon that is in it, you should also have the according taxonNode
218
     */
219
    @Deprecated
220
    public Map<UUID, List<MediaRepresentation>> getAllMediaForChildNodes(Taxon taxon, Classification taxTree, List<String> propertyPaths, int size, int height, int widthOrDuration, String[] mimeTypes);
221

  
222
    /**
223 207
     *
224 208
     * @param taxonNode
225 209
     * @param propertyPaths

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)