[Building Sakai] Is there a way to get the username?

Adrian Fish adrian.r.fish at gmail.com
Tue Jan 14 07:40:38 PST 2014


I thought that was an easy one to answer ...

I don't know if you can embed usernames in markup blocks. You'd need some
kind of token, embeddable in the markup, that gets transformed into the
user name at render time. It would be a big hit as well; every piece of
markup parsed for such tokens. I don't know if such a thing exists, sorry.

Cheers,
Adrian.


On 14 January 2014 15:18, Paul Dagnall <pdagnall1 at udayton.edu> wrote:

> Adrian - Is the UserDirectoryService exposed to the content area editable
> by the ckeditor though? My goal is for content creators to be able to make
> lessonbuilder content that would include such a link.
>
> Paul Dagnall
> Application Developer & Administrator
> University of Dayton
>
>
> On Tue, Jan 14, 2014 at 10:01 AM, Adrian Fish <adrian.r.fish at gmail.com>wrote:
>
>> Hi Paul,
>>
>> So, you're rendering a link in a lessonbuilder page, and you want to
>> embed the current user's name in it? In that case, just use
>> UserDirectoryService.getCurrentUser, which will get you a Sakai User
>> object. You can then call getFirstName, getLastName and getEid on that
>> object.
>>
>> If you have a look in ShowPageProducer, you'll see examples of that
>> method in use.
>>
>> Cheers,
>> Adrian.
>>
>>
>>  On 14 January 2014 14:51, Paul Dagnall <pdagnall1 at udayton.edu> wrote:
>>
>>>  Hi
>>> Does anyone know of a way to get the current user's username and expose
>>> it so it can be accessed by that user from a sakai content page?
>>>
>>> There is an external system we are trying to access from a html link in
>>> the Lessons tool. Basically we'd like the link to be something like this:
>>>
>>> http://externalSystem.edu/program.php?userName=*<current user name>*
>>> &otherParam=value
>>>
>>> I know there's a webservice that will get me the user name if I have the
>>> session id, which I don't think is available in that scope.
>>>
>>> Thanks!
>>>
>>> Paul Dagnall
>>> Application Developer & Administrator
>>> University of Dayton
>>>
>>>
>>> _______________________________________________
>>> 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"
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20140114/136bb95b/attachment.html 


More information about the sakai-dev mailing list