[Building Sakai] Profile2 user image

Matt Clare Matt.Clare at BrockU.CA
Fri Nov 4 12:11:28 PDT 2011


For the record, the direct URL /direct/profile/userid/image to the (privacy and preference checked) image from profile2 is one of it's best features.

If I was still a Firefox user, I'd have written a Grease Monkey Script to match our local student username patterns to inject the image on any of our Sakai pages long ago.  One of these days I'm going to try to figure out JavaScript bookmarklets to made it work with Chrome and others.

.\.\att

> 
> Message: 2
> Date: Thu, 3 Nov 2011 23:08:06 +0200
> From: David Wafula <davidwaf at gmail.com>
> Subject: Re: [Building Sakai] Profile2 user image
> To: Steve Swinsburg <steve.swinsburg at gmail.com>
> Cc: Sakai Developers <sakai-dev at collab.sakaiproject.org>
> Message-ID:
> 	<CAK9Ws2ed1yW4aTiVV_TtS+KAe+88_i30c6wp+KYL0+uxkMDnWQ at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Thank you!
> 
> On Fri, Oct 28, 2011 at 12:21 AM, Steve Swinsburg <steve.swinsburg at gmail.com
>> wrote:
> 
>> Hi,
>> 
>> You can use the following URL directly in your HTML to get a user's image:
>> 
>> /direct/profile/userid/image
>> 
>> This will always return a (privacy and preference checked) image and
>> according to any config you have in sakai.properties for Profile2. You can
>> read more about it here:
>> 
>> http://nightly2.sakaiproject.org:8082/direct/profile/describe
>> 
>> Retrieve the profile image for a user. Append /thumb to get the thumbnail
>> (/profile/USER/image/thumb) if there is one. If there is no thumbnail, the
>> main image will be returned. Optionally add the siteId URL param to allow
>> site permissions to be checked (/profile/USER/image?siteId={siteid} or
>> /profile/USER/image/thumb?siteId={siteid}) Returns binary of the image.
>> Returns default image if no image exists or not allowed. Return 404 if user
>> (or optional siteId) is invalid. Will always return an image if one exists,
>> either by being uploaded or being a url (depending on how the system has
>> been configured - see Profile2 sakai.properties. You can use it directly in
>> an img tag <img src="/profile/USER/image[/thumb]" />, it should always
>> return something. DO NOT specify any return format, ie .xml.
>> 
>> cheers,
>> Steve
>> 
>> 
>> On 28/10/2011, at 8:30 AM, David Wafula wrote:
>> 
>> Team,
>> How do i get (programmatically of course), profile picture  of a user, if
>> all i have is a User object ?
>> 
>> thanks.
>> --
>> David Wafula
>> _______________________________________________
>> sakai-dev mailing list
>> sakai-dev at collab.sakaiproject.org
>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>> 
>> TO UNSUBSCRIBE: send email to
>> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
>> "unsubscribe"
>> 
>> 
>> 

  ::  Matt Clare
Centre for Teaching Learning and Educational Technologies (CTLET)
Part-time Instructor, Interactive Arts and Sciences
Brock University, Niagara Region, Ontario, Canada
www.brocku.ca/ctlet  905 688 5550 xt 4539   Office: SBH315

Isaak/Sakai Question? Contact edtech at brocku.ca or visit  http://kumu.brocku.ca/sakai/FAQ



More information about the sakai-dev mailing list