The Sakai 2 Mercury Portal provides a [Tool] developer with a shortcut for accessing tools during development.
To get a peek at this portal in a Sakai 2 deployment simply change the URL from yourserver.edu/portal to yourserver.edu/mercury
The Mercury portal scans the installed tools and categorizes them by [registration category], such as sakai.sample, sakai.helper, and sakai.test
Mercury generates a [placement] for the Tool on the fly. A Developer can tinker around with the Tool context by directly manipulating the URL in their browser. This state is preserved untill the container is restarted.
Glenn Golden provided a link to a document describing the Mercury Portal
.
—
Glenn R. Golden, April 10, 2005
Mercury is a Sakai portal. It meets the needs of Sakai developers to access their tools in a simple and direct way while developing.
As a portal, Mercury provides a URL space for Sakai; it recognizes URLs and maps them to various capabilities. Mercury's URLs recognize 3 simple cases:
- home display
- tool access
- login
Mercury is much simpler to use for development than other Sakai portals. While the Varuna portal from Sakai 1 could be used, Varuna is the Site aware portal, so you would have to setup a Site and place your tool in order to test it out. And while the upcoming Astro portal for Sakai 2 could be used, Astro is the SuperStructure aware portal, so you would have to setup a SuperStructure and place your tool within in it to test it out.
To use Mercury, all you need to do is have a Sakai tool properly configured and running, and it will be accessible directly from the home display or by simple URL.
Mercury provides the necessary concepts of tool placement and context, in a simple, minimalist way, just enough to support these requirements of Sakai tools.
Software
Mercury software is in the portal module, in the mercury project. It is a single
Servlet. The project produces a .war artifact called mercury.war. This allows the portal to be accessed with the URL:
/mercury
Home Display
Accessing the portal with no path, or with the path "/mercury/home", produces the home display. This has a link to login, and shows information about the
- current user session
- registered tools
- registered helpers
- registered test tools
- registered sample tools
- current set of tool placements
This display acts as a quick check that your tool is properly available and registered.
Tools that are intended to show sample code and are marked with the registration category sakai.sample show up in the samples list; those that are intended just for testing and are marked with the sakai.test category show up in the test list.
Tools that are intended to be used as a helper tools and are marked with the category sakai.helper show up in the helper list. Helper tools are not directly accessible. Tools listed in the main, sample and test lists can be invoked by clicking on their tool id.
Tool Invocation
To invoke a tool, Mercury must have a tool placement and a tool context, as well as the tool id. The default context used in Mercury is "mercury". A tool placement is created as needed for each tool invocation; this is unique by the tool id and context. So each tool in the "mercury" context has a different tool placement, and the same tool in different contexts have different tool placements. Mercury remembers these placements while it is running; they are reset when the server resets.
Mercury recognizes the following URL pattern as a tool invocation:
/mercury/tool.id/context/path for tool
where:
- tool.id is the tool's registered tool id, such as sakai.chat, and
- context is the context string
- path for tool is the path info string sent to the tool when invoked
The URLs generated in Mercury's home page display default to use the "mercury"
context, but you can enter any other context string with a direct URL.
Tools are given the full browser window in which to interact. To "return" from a tool, enter the / or /home URL to get back to the home display.
After invoking a tool, you will see the placement listed in the home display. If the placement accumulated any configuration information, this will be visible in the display.
Home Display
Accessing the portal with no path, or with the path "/mercury/home", produces the home display. This has a link to login, and shows information about the
- current user session
- registered tools
- registered helpers
- registered test tools
- registered sample tools
- current set of tool placements
The Mercury home display starts by showing the current session information:

Tools that are intended to show sample code and are marked with the registration
category sakai.sample show up in the samples list; those that are intended just for testing and are marked with the sakai.test category show up in the test list.
Tools that are intended to be used as a helper tools and are marked with the category sakai.helper show up in the helper list. Helper tools are not directly accessible.
Tools listed in the main, sample and test lists can be invoked by clicking on their tool id.

The tool placements that are currently being tracked are displayed. If the tool has configured its placement, these values can be seen in the display.

In a production Sakai portal, placements would be explicitly created and permanently persisted. Mercury takes a short cut here to create placements automatically, and track them only for the run of the server. Be careful not to get the wrong idea about tool placements from this!
Login
The login link at the top of the home display invokes the helper tool sakai.login. This login tool knows how to recognize container authentication, and otherwise how to work with the Sakai Authentication API (a Sakai Common API) to authenticate the end user.
If the Authentication component installed in your Sakai supports container
authentication, and you have setup your sakai2-login web application's web.xml and your tomcat appropriately, the login will use basic http authentication to get your user enterprise id and password. Once tomcat is happy with you, the authentication component will lookup your end user records based on the enterprise id reported by tomcat, and register your user uuid and enterprise id in the Sakai session.


You can of course hook up any other form of container authentication; this http basic authentication is just an example.
Otherwise, the login process will present a dialog to collect the user enterprise id and password:

Consult other documentation for more details about login and authentication.
Mercury Login Lists - Glenn Golden
I have been testing a new feature using Mercury, and I have had to login as the demo "student1" user about a zillion times now... my fingers are tired.
Now, add this to your sakai.properties, and get a list of login links in Mercury. Click on the link to login as that user. Fun.
Don't forget to enable mercury!
mercury.enabled=true
mercury.login.count=3
mercury.password.count=3
mercury.login.1=student1
mercury.password.1=sakai
mercury.login.2=student2
mercury.password.2=sakai
mercury.login.3=instructor
mercury.password.3=sakai