Hello world,
I have some questions about the image management through bloblstore
API. I assume I have to save the image blobkey as string in all the db
models that need this image. For example, imagine we have an User
which makes comments on different "System Entities". For avoid to get
an user profile when displaying comment is needed (such as facebook
network), we get blob_image_string_key from Comments entity instead
getting it from User profile or get it as an url.
But there is one problem. For displaying Images by blobkey, I need to
make two calls to the server. One for transform this key on
BlobStoreServingUrl and another one for get the image itself. Of
course I think I can "preprocess" the data model at server and get
serving url at one step but I obtain an exception.
This is the code I use for "preprocess" data model and get serving
url. But imagesService.getServingUrl(blobKey) crash. Can anyone help
me??
class ImageUtils () {
public static String getUrlFromBlob (String blob)
{
BlobKey blobKey = new BlobKey(blob);
System.out.println ("IMAGEUTILS:: getUrlFromBlob:blob " + blob);
ImagesService imagesService =
ImagesServiceFactory.getImagesService();
String imageUrl = imagesService.getServingUrl(blobKey);
System.out.println ("IMAGEUTILS:: getUrlFromBlob:imageUrl" +
imageUrl);
if (ServletConstants.DEVELOPMENT_MODE)
return (imageUrl.replaceFirst("http://0.0.0.0:8888,
ServletConstants.DEVELOPMENT_MODE_URL));
else
return imageUrl;
}
}
Entities
User oneUser
Comment oneUserComment
Entity commentedEntity
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.