Author: mir
Date: Wed Sep 29 13:24:21 2010
New Revision: 1002614

URL: http://svn.apache.org/viewvc?rev=1002614&view=rev
Log:
CLEREZZA-232: added javadoc

Modified:
    
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.content.representations/org.apache.clerezza.platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/AlternativeRepresentationGenerator.java
    
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.content.representations/org.apache.clerezza.platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/ThumbnailService.java

Modified: 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.content.representations/org.apache.clerezza.platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/AlternativeRepresentationGenerator.java
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.content.representations/org.apache.clerezza.platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/AlternativeRepresentationGenerator.java?rev=1002614&r1=1002613&r2=1002614&view=diff
==============================================================================
--- 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.content.representations/org.apache.clerezza.platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/AlternativeRepresentationGenerator.java
 (original)
+++ 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.content.representations/org.apache.clerezza.platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/AlternativeRepresentationGenerator.java
 Wed Sep 29 13:24:21 2010
@@ -162,11 +162,41 @@ public class AlternativeRepresentationGe
                        generateAlternativeImages(data, mediaType, node);
                }
        }
-       
+
+       /**
+        * Generates an alternative image of the image at the specified 
infoBitNode.
+        * The parameters width and height specify the dimensions the generated
+        * image should have. The image will be resized to fit the specified
+        * dimensions (height and width of the generated image will be smaller
+        * or equals the specified width and height). Returns the URI of the
+        * generated image.
+        *
+        * @param infoBitNode an infoDiscoBit of media type image
+        * @param width the width the generated image should have
+        * @param height the height the generated image should have
+        * @return the URI of the generated image
+        */
        public UriRef generateAlternativeImage(GraphNode infoBitNode, int 
width, int height) {
                return generateAlternativeImage(infoBitNode, width, height, 
false);
        }
-       
+
+       /**
+        * Generates an alternative image of the image at the specified 
infoBitNode.
+        * The parameters width and height specify the dimensions the generated
+        * image should have. If exact is true, then the generated image will be
+        * resized and cropped to match the specified width and height exactly. 
If
+        * exact is false, then the image will be resized to fit the specified
+        * dimensions (height and width of the generated image will be smaller
+        * or equals the specified width and height). Returns the URI of the
+        * generated image.
+        *
+        * @param infoBitNode an infoDiscoBit of media type image
+        * @param width the width the generated image should have
+        * @param height the height the generated image should have
+        * @param exact specifies if the generated image must have the exact
+        *              width and height or not.
+        * @return the URI of the generated image
+        */
        public UriRef generateAlternativeImage(GraphNode infoBitNode, int 
width, int height, 
                        boolean exact) {
                try {

Modified: 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.content.representations/org.apache.clerezza.platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/ThumbnailService.java
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.content.representations/org.apache.clerezza.platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/ThumbnailService.java?rev=1002614&r1=1002613&r2=1002614&view=diff
==============================================================================
--- 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.content.representations/org.apache.clerezza.platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/ThumbnailService.java
 (original)
+++ 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.content.representations/org.apache.clerezza.platform.content.representations.core/src/main/java/org/apache/clerezza/platform/content/representations/core/ThumbnailService.java
 Wed Sep 29 13:24:21 2010
@@ -102,16 +102,22 @@ public class ThumbnailService implements
         * Returns the thumbnail uri for a InfoDiscoBit which is located at the 
uri
         * specified over the query parameter "uri". The thumbnails
         * maximum width and height can optionally be specified over the query 
parameters
-        * "width" and "height". If more than one acceptable thumbnail is 
available
-        * then the thumbnail uri of the thumbnail with the highest resolution
+        * "width" and "height". Futhermore there is the optional "exact" 
parameter,
+        * which specifies if the thumbnail must have the exact width and 
height as
+        * specified or not (default is "false"). If more than one acceptable 
thumbnail
+        * is available then the thumbnail uri of the thumbnail with the 
highest resolution
         * (width * height) is returned. If no thumbnail is available and the 
logged
         * in user has the write permission for the content graph, then an 
attempt is
         * made to create the thumbnail on the fly. If this fails or the write 
permission
         * is missing, then the uri of the icon representing the media type is 
returned.
         * If also no media type icon is available the uri to default icon is 
returned.
-        * @param infoBitUri the uri of the infoDiscoBit of which the thumbnail 
uri should be returned
+        *
+        * @param infoBitUri the uri of the infoDiscoBit of which the thumbnail 
uri should
+        *              be returned
         * @param height the maximum height that the thumbnail has
         * @param width the maximum width that the thumbnail has
+        * @param exact boolean that specifies if the return thumbnail should 
have
+        *              the exact width and height.
         * @return
         */
        @GET
@@ -122,10 +128,51 @@ public class ThumbnailService implements
                                getThumbnailUri(infoBitUri, width, height, 
exact).getUnicodeString(), uriInfo);
        }
 
+
+       /**
+        * Returns the thumbnail uri for a InfoDiscoBit which is located at the 
uri
+        * specified over the query parameter "uri". The thumbnails
+        * maximum width and height can optionally be specified over the query 
parameters
+        * "width" and "height". If more than one acceptable thumbnail is 
available
+        * then the thumbnail uri of the thumbnail with the highest resolution
+        * (width * height) is returned. If no thumbnail is available and the 
logged
+        * in user has the write permission for the content graph, then an 
attempt is
+        * made to create the thumbnail on the fly. If this fails or the write 
permission
+        * is missing, then the uri of the icon representing the media type is 
returned.
+        * If also no media type icon is available the uri to default icon is 
returned.
+        *
+        * @param infoBitUri the uri of the infoDiscoBit of which the thumbnail 
uri should
+        *              be returned
+        * @param height the maximum height that the thumbnail has
+        * @param width the maximum width that the thumbnail has
+        * @return
+        */
        public UriRef getThumbnailUri(UriRef infoBitUri, Integer width,  
Integer height) {
                return getThumbnailUri(infoBitUri, width, height, false);
        }
 
+       /**
+        * Returns the thumbnail uri for a InfoDiscoBit which is located at the 
uri
+        * specified over the query parameter "uri". The thumbnails
+        * maximum width and height can optionally be specified over the query 
parameters
+        * "width" and "height". Futhermore there is the optional "exact" 
parameter,
+        * which specifies if the thumbnail must have the exact width and 
height as
+        * specified or not. If more than one acceptable thumbnail is available 
then
+        * the thumbnail uri of the thumbnail with the highest resolution 
(width * height)
+        * is returned. If no thumbnail is available and the logged in user has 
the write
+        * permission for the content graph, then an attempt is made to create 
the
+        * thumbnail on the fly. If this fails or the write permission is 
missing, then
+        * the uri of the icon representing the media type is returned. If also 
no
+        * media type icon is available the uri to default icon is returned.
+        *
+        * @param infoBitUri the uri of the infoDiscoBit of which the thumbnail 
uri should
+        *              be returned
+        * @param height the maximum height that the thumbnail has
+        * @param width the maximum width that the thumbnail has
+        * @param exact boolean that specifies if the return thumbnail should 
have
+        *              the exact width and height.
+        * @return
+        */
        public UriRef getThumbnailUri(UriRef infoBitUri, Integer width,  
Integer height,
                        boolean exact) {
                if ((width == null) && (height == null)) {


Reply via email to