[Building Sakai] Sakai session variables/passing parameters to the Web Content tool?

Matthew Jones jonespm at umich.edu
Thu Feb 24 07:22:14 PST 2011


You were close, the variables are listed here [1]
${SITE_ID},${USER_ID},${USER_EID},${USER_FIRST_NAME},${USER_LAST_NAME},${USER_ROLE},
and ${SESSION_ID}.

By default all of these except ${SESSION_ID} are included in this property.
private static final String MACRO_DEFAULT_ALLOWED =
"${USER_ID},${USER_EID},${USER_FIRST_NAME},${USER_LAST_NAME},${SITE_ID},${USER_ROLE}";

Here's an example calling "test.php" to print out the variables, run on the
nightly server.

<some remote
server>/test.php?siteId=${SITE_ID}&userId=${USER_ID}&userEid=${USER_EID}&userFirst=${USER_FIRST_NAME}&userLast=${USER_LAST_NAME}&userRole=${USER_ROLE}&sessionId=${SESSION_ID}

*(test.php)*
  1 <?
  2 print_r($_GET);
  3 ?>
[image: Screenshot.png]This is all defined in IFrameAction.java [2] in the
web tool

If you want something more advanced you can look at BasicLTI which ensures
identity and passes more information about a user.

[1]
https://confluence.sakaiproject.org/display/DOC/Sakai+Properties+Reference+-+I
[2]
https://source.sakaiproject.org/svn/web/trunk/web-tool/tool/src/java/org/sakaiproject/web/tool/IFrameAction.java

-Matthew

On Thu, Feb 24, 2011 at 8:27 AM, Grogan, David <David.Grogan at tufts.edu>wrote:

> Hello all,
>
> As a user of Confluence I'm used to having the convenience of session
> variable such as "$!user.fullName" to be able to dynamically display info
> where needed.
>
> Does Sakai have anything like this?
>
> e.g. a use case I'd love to be able to implement is creating a site
> template with a Web Content tool with the URL:
>
> http://somesite.edu/portal?courseid=$sakai.SiteID
>
> Anything available along those lines?
>
> David
>
> --------------------------------------------------------------
> David Grogan
> Senior Solutions Specialist
> Educational & Scholarly Technology Services (ESTS)
> University Information Technology (UIT) Tufts University
> 16 Dearborn Rd
> Somerville, MA  02144
>
> Phone: 617.627.2859
> Fax: 617.627.3082
>
> http://uit.tufts.edu/at/
>
>
> _______________________________________________
> 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/20110224/656643e0/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 16009 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20110224/656643e0/attachment.png 


More information about the sakai-dev mailing list